This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$GroupObject = Get-ADGroup 'MyGroupName' | |
$NTPrincipal = Get-ADUser 'myUserName' | |
if ($GroupObject -and $NTPrincipal) { | |
$acl = Get-Acl "AD:$($GroupObject.distinguishedName)" | |
$identity = [System.Security.Principal.IdentityReference] $NTPrincipal.SID | |
$adRights = [System.DirectoryServices.ActiveDirectoryRights]::WriteProperty -bor [System.DirectoryServices.ActiveDirectoryRights]::WriteDacl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-DeepADMembership | |
{ | |
[cmdletbinding()] | |
param ( | |
[Parameter(Mandatory, | |
ParameterSetName = 'ByDN')] | |
[string[]]$DN, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Computer_List = Get-ADComputer -Filter * | Select-Object -ExpandProperty Name | |
foreach ($computer in $Computer_List) | |
{ | |
$obj = [pscustomobject][ordered] @{ | |
ComputerName = $computer | |
IPAddress = '' | |
PingTest = $false | |
PSRemotingEnabled = $false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cs = New-CimSession -ComputerName SERVER001 | |
New-NetEventSession -CimSession $cs -Name mycap -LocalFilePath c:\temp\netcapture.etl | |
Add-NetEventPacketCaptureProvider -CimSession $cs -SessionName mycap | |
Start-NetEventSession -CimSession $cs -Name mycap | |
break | |
# run these next two lines to stop the capture | |
Stop-NetEventSession -CimSession $cs -Name mycap | |
Remove-NetEventSession -CimSession $cs -Name mycap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function BuildPath | |
{ | |
param( | |
[system.collections.arraylist]$PathElements | |
) | |
do | |
{ | |
$PathElements[1] = join-path $PathElements[0] $PathElements[1] | |
$PathElements.RemoveRange(0,1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Converts Identity object schemas | |
.DESCRIPTION | |
This function will take an array of identity objects from HRS format and | |
convert into objects using a nested object schema with attributes specified | |
in an attribute mapping hashtable parameter | |
.EXAMPLE | |
$orgAttrIdMap = @{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function Get-myADUserInfo | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[string[]]$Username | |
) | |
Begin |