Category Archives: Scripts

ADConnect permission issues with adminCount accounts

Once I was working on migrating Azure AD Connect from one server to another. After the migration, no matter that the account had rights on the SDadmin folder, some accounts failed to be updated with an insufficient rights error.

After some digging, I found that some accounts historically have adminCount set to 1 and inheritance turned off, so to fix that, I used the following script below:

Continue reading

Скрипт для раскладывания файлов по дате создания.

Была задачка отсортировать файлы по дате, решил написать небольшой скриптик для этого.

$F = “C:\Camera\jpg”
Get-ChildItem $F | ForEach-Object {
$D1=$_.Creationtime.day
$D2=$_.Creationtime.month
$D3=$_.Creationtime.year
$T=”C:\Camera\sort\$D1.$D2.$D3″
robocopy $F $T $_.name /MOV
}

Скрипт для настройки автоответа пользователю.

Cкрипт для настройке автоответа пользователю.

Set-MailboxAutoReplyConfiguration [email protected] -AutoReplyState Scheduled -StartTime “9/8/2011” -EndTime “9/15/2011” -ExternalMessage “Сообщение_для_внешних_отправителей” -InternalMessage “Сообщение_для_внутренних_отправителей”

Чтобы настроить работу функции автоматического ответа до тех пор, пока она не будет отключена (т. е. без расписания), присвойте параметру AutoReplyState значение Enabled и не указывайте параметры StarTime и EndTime .