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
[Cmdletbinding()] | |
Param ([Parameter(Mandatory = $true, ValuefromPipeline = $true, ValuefromPipeLinebypropertyName = $true, Position = 1 )]$User, | |
[parameter(Mandatory = $True, ValuefromPipeline = $true, ValuefromPipeLinebypropertyName = $true, Position = 2 )]$OU, | |
[parameter(Mandatory = $True, ValuefromPipeline = $true, ValuefromPipeLinebypropertyName = $true, Position = 3)]$ObjectName, | |
[Parameter(Mandatory = $True, ValuefromPipeline = $true, ValuefromPipeLinebypropertyName = $true, Position = 4)]$SamName, | |
[Parameter(Mandatory = $True, ValuefromPipeline = $true, ValuefromPipeLinebypropertyName = $true, Position = 5)]$DisplayName, | |
[Parameter(Mandatory = $True, ValuefromPipeline = $true, ValuefromPipeLinebypropertyName = $true, Position = 6)]$UPN, | |
[Parameter(Mandatory = $True, ValuefromPipeline = $true, ValuefromPipeLinebypropertyName = $true, Position = 7)]$Email | |
) | |
#$RidMaster1 = "RID Master servers" |
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
#Disabele Retail domain accounts | |
Param( | |
[Parameter(Mandatory=$true,ValuefromPipeline=$false,ValuefromPipeLinebypropertyName=$true,Position=1 )]$RetailUser | |
) | |
$DisabeledUser = Get-ADUser -Server tewwvapwdc05.retail.sephoraus.com -Identity $RetailUser -Properties Manager -Verbose | |
Write-Output $DisabeledUser | |
if ($null -ne $DisabeledUser ) { | |
$DisableAccount = $DisabeledUser |Disable-ADAccount -Confirm | |