all demo
This commit is contained in:
8
jenkins/getmailbox.ps1
Normal file
8
jenkins/getmailbox.ps1
Normal 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
|
||||
Reference in New Issue
Block a user