$Dir = "\\server\share\"
$Users = Get-ADUser -Filter * -SearchBase "OU=OU,DC=domen,DC=ru"
foreach ($User in $Users) {
$User1 = $User.Name
$Path = New-Item -ItemType Directory -Path $Dir -Name $User1
$User = $User.sAMAccountName
$Path1 = $Dir + "\" + $User1
$Args = New-Object system.security.accesscontrol.filesystemaccessrule($User,"Modify, Synchronize", "ContainerInherit, ObjectInherit", "None", "Allow")
$ACL = Get-Acl $Path
$ACL.SetAccessRule($Args)
Set-Acl -Path $Path -AclObject $ACL
Set-ADUser -Identity $User -HomeDrive "W:" -HomeDirectory "$Path1" -Server server
}
Microsoft Outlook 2013/Outlook Options/Mail Format/International Optionshide
Policy Setting Comment
Auto-select encoding for outgoing messages Enabled
Encoding for outgoing messages Enabled
Use this encoding for outgoing messages: Unicode (UTF-8)
foreach ($Computer in $Computers) {
$Computer = $Computer.toupper()
$Isonline = "OFFLINE"
$Status = "SUCCESS"
Write-Verbose "Working on $Computer"
if((Test-Connection -ComputerName $Computer -count 1 -ErrorAction 0)) {
$Isonline = "ONLINE"
Write-Verbose "`t$Computer is Online"
} else { Write-Verbose "`t$Computer is OFFLINE" }
try {
$account = [ADSI]("WinNT://$Computer/Administrator,user")
$account.psbase.invoke("setpassword",$pwd1_text)
Write-Verbose "`tPassword Change completed successfully"
}
catch {
$status = "FAILED"
Write-Verbose "`tFailed to Change the administrator password. Error: $_"
}
$obj = New-Object -TypeName PSObject -Property @{
ComputerName = $Computer
IsOnline = $Isonline
PasswordChangeStatus = $Status
}
$obj | Select ComputerName, IsOnline, PasswordChangeStatus
if($Status -eq "FAILED" -or $Isonline -eq "OFFLINE") {
$stream.writeline("$Computer `t $isonline `t $status")
}
}
Windows SteadyState - это прекращенный бесплатный инструмент, разработанный Microsoft, который предоставляет администраторам расширенные возможности для настройки общих компьютеров, такие как защита жесткого диска и расширенное управление пользователями.