posts-powershell

Finding Explicit Permissions

Finding Explicit Permissions

All PowerShell versions Typically, NTFS permissions in the file system are inherited. You can, however, add explicit permissions to files and...

Finding Explicit Permissions

Accessing COM Objects without ProgID

All Versions Typically, to access COM objects, these objects need to register themselves in the Windows Registry, and PowerShell needs the...

Finding Explicit Permissions

Changing GPO Description/Comment

GroupPolicy Module When you create a new Group Policy, you can set a comment (or description). There is no apparent way, however, to change the...

Finding Explicit Permissions

Finding Minimum and Maximum Values

All PowerShell Versions To find the smallest and largest item in a range of numbers, use Measure-Object: $list = 1,4,3,1,3,12,990 $result = $list |...

Finding Explicit Permissions

Testing UNC Paths

Test-Path can test whether or not a given file or folder exists. This works fine for paths that use a drive letter, but can fail with pure UNC...

Finding Explicit Permissions

Use $PSScriptRoot to Load Resources

Beginning in PowerShell 3.0, there is a new automatic variable available called $PSScriptRoot. This variable previously was only available within...

Finding Explicit Permissions

Converting Binary SID to String SID

Converting SID from Binary to String Active Directory accounts contain the SID in binary form. To convert the byte array into a string...