Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Query directory for NTFS permissions for a particular user

$
0
0

I am struggling to crack this one.

So for example:

Powershell
$dir=\\server\share\dir1\dir2\target_dir$account=DOMAIN\service_account

I want to query the NTFS permissions for $account on $dir.

The task is to allow a script to confirm that the account has modify (at least) before continuing with the scripts main operation.

I have tried using the following cmdlets, but not had the desired success.

Powershell
Get-NTFSAccessGet-NTFSEffectiveAccess

What I want to achieve ultimately is something like this:

If permissions on $dir are modify or above
Then continue with script
Else add to list, and send FYI.


Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images