Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

Need ideas for script with split credentials

$
0
0

Horrible Title, I know…

I have a simple script that I want to run as the logged in user. I need it to run as the user because it grabs all of their outlook contacts and exports as a csv. I need to get the csv moved to a DFS share to be imported into a DB later on. The problem is, I don’t want the users to have access to the DFS path.

I can’t seem to find a good way to go about this. Obviously the export-csv cmdlt doesn’t accept -credentials. I tried creating a new-psdrive for this, but the DFS path shares the same root folder path as other DFS drives currently mapped so PS gives me the finger. I’ve read that copy-item accepts the -credential switch, but only on newer version of PS. I can post the script if needed

TLDR; I need a script to run as the logged in user, but can’t think of a good way to move/export to a restricted path with elevated credentials within the same script

submitted by /u/STL_reddit
[link] [comments]

The post Need ideas for script with split credentials appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Trending Articles