Differences
This shows you the differences between two versions of the page.
ms_windows_ms_sql:remote_ad_expired_password_reset [2019/09/02 07:07] – created admin | ms_windows_ms_sql:remote_ad_expired_password_reset [2019/09/02 07:09] (current) – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Проблема ====== | ||
+ | Просрочился пароль. Залогиниться не удается. Доступа к консоли компа нет - только удаленный доступ в сеть. \\ | ||
+ | Как удаленно сбросить просроченный пароль от учетки **Active Directory**, | ||
+ | ====== Решение ====== | ||
+ | Можно применить скрипт **Powershell**: | ||
+ | |||
+ | < | ||
+ | [CmdletBinding()] | ||
+ | param( | ||
+ | [Parameter(Mandatory = $true)][string] $UserName, | ||
+ | [Parameter(Mandatory = $true)][string] $OldPassword, | ||
+ | [Parameter(Mandatory = $true)][string] $NewPassword, | ||
+ | [Parameter(Mandatory = $true)][alias(' | ||
+ | ) | ||
+ | $DllImport = ' | ||
+ | [DllImport(" | ||
+ | public static extern bool NetUserChangePassword(string domain, string username, string oldpassword, | ||
+ | ' | ||
+ | $NetApi32 = Add-Type -MemberDefinition $DllImport -Name ' | ||
+ | if ($result = $NetApi32:: | ||
+ | Write-Output -InputObject ' | ||
+ | } else { | ||
+ | Write-Output -InputObject ' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | Set-PasswordRemotely ' |