Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- Function show-user {
- param ([String]$uname)
- Get-AdUser -identity $uname -Properties name,CanonicalName,EmailAddress,telephoneNumber,Manager,CannotChangePassword,Enabled,LockedOut,PasswordExpired,PasswordLastSet,PasswordNeverExpires,HomeDirectory|select-object -Property name,CanonicalName,EmailAddress,telephoneNumber,Manager,CannotChangePassword,Enabled,LockedOut,PasswordExpired,PasswordLastSet,PasswordNeverExpires,HomeDirectory
- }
- Function reset-pwd ([String]$uname) {
- #$newpwd = Read-Host "Enter the new password" -AsSecureString
- Set-ADAccountPassword $uname -NewPassword $newpwd –Reset -confirm -PassThru
- Write-Host "$uname password reset"
- }
- Function reset-user ([String]$uname) {
- Enable-ADAccount -Identity $uname -Confirm -PassThru
- Write-Host "$uname account enabled"
- }
- Function move-oldpc {
- param ([String]$pcname)
- $adpcname=get-adcomputer $pcname -Properties distinguishedname|Select-Object -Property distinguish
- Disable-ADAccount "$adpcname -Confirm -PassThru"
- Move-ADObject -Identity $adpcname -TargetPath "PATHTOOU" -Confirm -PassThru
- Write-Host "$pcname has been disabled and moved to disabled workstations"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement