cleanup
This commit is contained in:
parent
001bb952c6
commit
836355a879
18
New-User.ps1
18
New-User.ps1
@ -1,18 +0,0 @@
|
|||||||
<#
|
|
||||||
Script to generate new users
|
|
||||||
|
|
||||||
#>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$UserFirstName
|
|
||||||
$UserLastName
|
|
||||||
$UserOffice
|
|
||||||
$UserEmail
|
|
||||||
$UserMobilePhone
|
|
||||||
$userOfficePhone
|
|
||||||
$UserExtension
|
|
||||||
$UserJobTitle
|
|
||||||
$UserDesignation
|
|
||||||
$UserOrgUnit
|
|
@ -1,16 +0,0 @@
|
|||||||
$cred=Get-Credential
|
|
||||||
$countryHash = @{
|
|
||||||
# canada is 124
|
|
||||||
countryCode = 0124
|
|
||||||
}
|
|
||||||
|
|
||||||
$User=Get-ADUser -Filter * -SearchBase 'OU=MPEUsers,DC=mpe,DC=ca' -Properties c,co,countryCode | Where-Object countryCode -NE 124
|
|
||||||
foreach ($u in $User){
|
|
||||||
$u | Set-ADUser -Country 'CA' -Credential $cred
|
|
||||||
if ($u.countryCode -eq 0 ) {
|
|
||||||
Write-Output $u.Name
|
|
||||||
$u | set-adobject -Add $countryHash -Credential $cred -ErrorAction SilentlyContinue
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user