- Open a PowerShell session
- $Cred = Get-Credential
- $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
- Import-PSSession $Session
Jeśli wystąpi problel z punktem 4 należy zmienić politykę:
Set-ExecutionPolicy RemoteSigned
Cały przykład:
$Cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Cred -Authentication Basic -AllowRedirection
Import-PSSession $Session
# Run any commands you want here
Remove-PSSession $Session
Komentarze
Komentarze: 0
Zaloguj się, aby dodać komentarz.