Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

active directory user kopieren per powershell

[regex]$regex = "(?:,)(?'name'((CN|OU=).*))"

Get-ADUser -Filter * -SearchBase "OU=Benutzer,DC=ad2016,DC=faq-o-matic,DC=net" | ForEach-Object {
    $ou = $regex.Match($_.DistinguishedName).Groups['name']

    Write-Host($_.Name + ": $ou")
    $_ | Set-ADUser -Add @{info=$ou}
}
Source by www.faq-o-matic.net #
 
PREVIOUS NEXT
Tagged: #active #directory #user #kopieren #powershell
ADD COMMENT
Topic
Name
2+8 =