This commit is contained in:
Pavel Guzaev
2024-03-09 17:36:50 +05:00
commit 431b4f5cfd
44 changed files with 3239 additions and 0 deletions

8
jenkins/getmailbox.ps1 Normal file
View File

@@ -0,0 +1,8 @@
$username='adm_exch@domain'
$pwsd='superpass'
$password = ConvertTo-SecureString $pwsd -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ($username, $password)
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://win2016-dc-exch.domain/powershell/ -Authentication Basic -AllowRedirection -Credential $Cred
Invoke-Command -Session $Session -ScriptBlock { Get-Mailbox -OrganizationalUnit domain/NSD -ResultSize Unlimited } | Format-List DisplayName, WindowsEmailAddress, CustomAttribute1 | Out-File -Encoding UTF8 mailbox.nausd
Remove-PSSession $Session