Это называется Sender-Based Routing. Штатными средствами Exchange это не настраивается - требуется стороннее решение, например, специальный транспортный агент.
Exchange Sender Based Routing
RouteBySender
Sender Based Routing
конечная цель - увидеть список групп, в которых состоит пользовательесли вы используете Get-ADUser, то почему не пользуйтесь Get-ADPrincipalGroupMembership (Global Catalog, скорее всего, у вас есть)?
скрипт добавления других файлов в группу "Прошедшие проверку"только наоборот - группу добавляют в ACL файла
(irm $url)>$fнафига здесь перенаправление (redirection), если и irm (Invoke-RestMethod), и iwr (Invoke-WebRequest) умеют выводить в файл через -OutFile? В предыдущем вопросе про это писал...
irm bla-bla-bla | Out-File -Encoding UTF8...
Оказалось, что скачанный код почему-то сохранился в файл с кодировкой UTF-16 LEне знаю что и как у вас в системе настроено, но документация говорит следующее:
When you are writing to files, the redirection operators use UTF8NoBOM encoding. If the file has a different encoding, the output might not be formatted correctly. To write to files with a different encoding, use the Out-File cmdlet with its Encoding parameter.
Invoke-WebRequest -Uri 'https://github.com/Drovosek01/ReplaceHexPatcher/raw/refs/heads/main/core/v2/ReplaceHexBytesAll.ps1' -OutFile '%temp%\a.ps1'; %temp%\a.ps1 arg1 arg2 arg3
/bin/bash -c "curl -fsSL -o /tmp/a.sh https://raw.githubusercontent.com/Homebrew/install... && chmod 777 /tmp/a.sh && /tmp/a.sh arg1 arg2 arg3"делает ровно то же самое...
$computer_sys.Put() | Out-Null
...
$page_file.Put() | Out-Null
Set-WmiInstance -Class Win32_PageFileSetting -Arguments @{name="C:\pagefile.sys"; InitialSize = 4096; MaximumSize = 8192} -EnableAllPrivileges | Out-Null
Storage
You must use Storage Spaces Direct or shared storage that's compatible with Windows Server 2012 R2, Windows Server 2012, and later.
-Credential
Specifies the account used by the service as the Service Logon Account.
где каждому сотруднику присвоен ПК
$localuser = Get-LocalUser -Name $USERNAME
$localuser | Remove-LocalUser -Confirm:$false
$userprofile = Get-CimInstance -Class Win32_UserProfile | Where-Object { $_.SID -eq $localuser.SID }
$userprofile | Remove-CimInstance -Confirm:$false