This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Start-Process -FilePath "C:\Windows\System32\Sysprep\Sysprep.exe" -ArgumentList "/oobe /generalize /shutdown /mode:vm /quiet" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- Get-WindowsAutoPilotInfo.ps1 2020-09-21 17:42:58.000000000 +0200 | |
| +++ Get-WindowsAutoPilotInfo_new.ps1 2021-08-04 08:58:09.417595000 +0200 | |
| @@ -410,11 +410,24 @@ | |
| } | |
| } | |
| + $deviceUpdateParameter = @{} | |
| + | |
| # Assign the computer name | |
| if ($AssignedComputerName -ne "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #requires -Version 2 -Modules posh-git | |
| function Write-Theme { | |
| param( | |
| [bool] | |
| $lastCommandFailed, | |
| [string] | |
| $with | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $IgnoreUser = Get-Content ~\Downloads\user.txt | |
| $InactiveUsers = Get-ADUser -Filter * -Properties memberof | ?{$_.Enabled -eq $false -and $IgnoreUser -notcontains $_.samaccountname} | |
| $IgnoreGroups = Get-Content ~\Downloads\groups.txt | |
| $includeGroups = Get-Content ~\Downloads\groups2.txt | |
| foreach($user in $InactiveUsers){ | |
| $user.MemberOf | Get-ADGroup | ?{$IncludeGroups -contains $_.Name -and $IgnoreGroups -notcontains $_.Name} #| %{$_ | Remove-ADGroupMember -Members $user.SamAccountName -Confirm:$false} | |
| } |