2013-07-18 1 views
0

사용자의 관리자 자격 증명을 요구하는 Office 365 용 powershell에 로그인 할 Windows powershell 스크립트 용 스크립트를 얻는 방법에 대한 자세한 정보를 찾으려고합니다. 나는 이것을 검색 할 수있는 핵심어가 아니지만 많은 정보를 찾지 못했다. 손을 빌려주세요. 나는 그것을 할 스크립트를 원한다. 나는 그것에 관한 정보와 그것이 어떻게 작동 하는지를 찾고있다.Office 용 powershell에 로그인하는 Powershell 스크립트

$ SecPass1 =를 ConvertTo-securestring "
$ MSOLM = 새로운 객체 System.Management.Automation.PSCredential -argumentlist -force"비밀번호 "-String -asplaintext GlobalAdmin 일부 @ : 교환 PowerShell을 사용하기 위해

+0

내 이해가 맞다면 powershell에서 office 365를 시작하고 Office 365를 시작할 때 사용자의 crendentials를 요구합니다. 옳은? – Peter

+0

예이 줄을 따라 뭔가를 발견했습니다 $ cred = Get-Credential $ s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $ cred -Authentication Basic -AllowRedirection $ importresults = Import-PSSession $ s – user2596912

+0

@ user2596912 질문에 직접 대답 한 경우 의견이 아닌 대답으로 작성하면 동일한 질문을 가진 다른 사용자가 쉽게 대답을 찾을 수 있습니다. –

답변

2

.COM ", $ SecPass1
$ 세션 = 새-PSSession을 -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $ MSOLM - 인증 기본 -AllowRedirection
가져 오기 - 모듈 MSOnline 가져 오기 - PSSession을 $ 세션 -AllowClobber

1
,이 스크립트는 자격 증명을 요청하고 관리자로 사무실 365에 로그인합니다 : 내가 검색 한 당신이 단지 로그인보다 할 수있는 많은 작업이있는 경우, 내가 스크립트와 함께 당신을 도울 수있을

To Login: 


$LiveCred = Get-Credential 
$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection 
Import-PSSession $Session 

관련 문제