Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #181 from jtnord/password-expiration
Browse files Browse the repository at this point in the history
the /EXPIRE (sic) flag on `net user` does not set the password expiry
  • Loading branch information
slide authored Jun 25, 2020
2 parents 5c8036f + 7f25751 commit 98527ae
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion 11/nanoserver-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ RUN $output = net users ; `
if(-not ($output -match $env:user)) { `
Write-Host 'user does not exist?' ; `
net user $env:user /add /expire:never /passwordreq:no ; `
net localgroup Administrators /add $env:user `
net localgroup Administrators /add $env:user ; `
wmic useraccount WHERE Name=$env:user set PasswordExpires=false; `
}

COPY jenkins-agent.ps1 C:/ProgramData/Jenkins
Expand Down
3 changes: 2 additions & 1 deletion 11/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ RUN $output = net users ; `
if(-not ($output -match $env:user)) { `
Write-Host 'user does not exist?' ; `
net user $env:user /add /expire:never /passwordreq:no ; `
net localgroup Administrators /add $env:user `
net localgroup Administrators /add $env:user ; `
wmic useraccount WHERE Name=$env:user set PasswordExpires=false; `
}

COPY jenkins-agent.ps1 C:/ProgramData/Jenkins
Expand Down
3 changes: 2 additions & 1 deletion 8/nanoserver-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ RUN $output = net users ; `
if(-not ($output -match $env:user)) { `
Write-Host 'user does not exist?' ; `
net user $env:user /add /expire:never /passwordreq:no ; `
net localgroup Administrators /add $env:user `
net localgroup Administrators /add $env:user ; `
wmic useraccount WHERE Name=$env:user set PasswordExpires=false; `
}

COPY jenkins-agent.ps1 C:/ProgramData/Jenkins
Expand Down
3 changes: 2 additions & 1 deletion 8/windowsservercore-1809/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ RUN $output = net users ; `
if(-not ($output -match $env:user)) { `
Write-Host 'user does not exist?' ; `
net user $env:user /add /expire:never /passwordreq:no ; `
net localgroup Administrators /add $env:user `
net localgroup Administrators /add $env:user ; `
wmic useraccount WHERE Name=$env:user set PasswordExpires=false; `
}

COPY jenkins-agent.ps1 C:/ProgramData/Jenkins
Expand Down

0 comments on commit 98527ae

Please sign in to comment.