activedirectory:homepfadeangleichen
Dies ist eine alte Version des Dokuments!
Home-Pfade angleichen
Script
$users = get-aduser -filter {homeDirectory -like "*ERZ-FS*"} -properties homeDirectory $RemoteShares = Get-WMIObject win32_share -ComputerName "erz-fs" foreach ($user in $users) { $path = $user.homeDirectory.Split('\') $itemcount = $path.count $itemcount -= 1; $share = $path[3] if ($share -eq "homes$" -or $share -eq "user-daten") { $newHomeDirectoryPath = "\\evag.evg.int\UserData\Home\" + $path[$itemcount] } else { $newHomeDirectoryPath = "" $Share = $RemoteShares | Where-Object {$_.Name -eq $path[3]} if ($Share -ne $NULL) { $path = $Share.Path.Split('\') $itemcount = $path.count $itemcount -= 1 $newHomeDirectoryPath = "\\evag.evg.int\UserData\Home\" + $path[$itemcount] } } $newHomeDirectoryPath }
activedirectory/homepfadeangleichen.1427100203.txt.gz · Zuletzt geändert: 2016/04/02 00:37 (Externe Bearbeitung)