Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $host.ui.RawUI.WindowTitle = "Cambia Password"
- $pshost = Get-Host
- $pswindow = $pshost.UI.RawUI
- $newsize = $pswindow.windowsize
- $newsize.width = 65
- $newsize.height = 15
- $pswindow.windowsize = $newsize
- Write-Host "
- Requisiti di robustezza della password:
- - minimo 8 caratteri
- - almeno 3 tipi di caratteri tra:
- * maiuscole
- * minuscole
- * numeri
- * simboli
- Le password immesse di seguito saranno visibili a schermo,
- premere INVIO per confermare e crittografare la password.
- "
- [string]$oldPassword = $(Read-Host "Password attuale (INVIO per confermare)")
- [string]$newPassword = $(Read-Host "Nuova password (INVIO per confermare)")
- $ADSystemInfo = New-Object -ComObject ADSystemInfo
- $type = $ADSystemInfo.GetType()
- $user = [ADSI] "LDAP://$($type.InvokeMember('UserName', 'GetProperty', $null, $ADSystemInfo, $null))"
- $user.ChangePassword( $oldPassword, $newPassword)
- $oldPassword = "cleared"
- $newPassword = "cleared"
- Start-Sleep -s 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement