mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
Migrate Windows CI roles to test targets. (#18005)
This commit is contained in:
parent
9182619fef
commit
c2ec86cb78
81 changed files with 26 additions and 26 deletions
17
test/integration/targets/win_user/files/lockout_user.ps1
Normal file
17
test/integration/targets/win_user/files/lockout_user.ps1
Normal file
|
@ -0,0 +1,17 @@
|
|||
trap
|
||||
{
|
||||
Write-Error -ErrorRecord $_
|
||||
exit 1;
|
||||
}
|
||||
|
||||
$username = $args[0]
|
||||
[void][system.reflection.assembly]::LoadWithPartialName('System.DirectoryServices.AccountManagement')
|
||||
$pc = New-Object -TypeName System.DirectoryServices.AccountManagement.PrincipalContext 'Machine', $env:COMPUTERNAME
|
||||
For ($i = 1; $i -le 10; $i++) {
|
||||
try {
|
||||
$pc.ValidateCredentials($username, 'b@DP@ssw0rd')
|
||||
}
|
||||
catch {
|
||||
break
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue