o365:pshellconnect
Connessione alla PowerShell
Questo codice farà comparire il popup di richiesta password per l'accesso alla console Exchange, l'utente è pre-dichiarato tramite il “-Credential utente@dominio.tld”, come spiegato nell'articolo del blog all'indirizzo gioxx.org/2014/03/31/office-365-connessione-alla-powershell
- PShell-Start.ps1
$UserCredential = Get-Credential -Credential utente@dominio.tld $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session
Connessione alla PowerShell con un file password
Questo codice farà si autenticherà alla console Exchange senza l'intervento dell'utete, utilizzando un file password precedentemente criptato, come spiegato nell'articolo del blog all'indirizzo gioxx.org/2014/04/14/powershell-connettersi-con-utente-e-password-gia-stabiliti
- PShell-Start.ps1
$User = "utente@dominio.tld" $PWord = Get-Content C:\pshell\password.txt | ConvertTo-SecureString $Credential = New-Object –TypeName System.Management.Automation.PSCredential –ArgumentList $User, $PWord $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $Credential -Authentication Basic -AllowRedirection Import-PSSession $Session
o365/pshellconnect.txt · Last modified: 2014/04/14 09:34 by gfsadministrator