본문 바로가기
Product/Microsoft Product

Microsoft 365 및 클라우드 서비스 PowerShell 연결 방법 총정리

by Kaga 2025. 3. 10.
728x90
반응형

Microsoft 365(M365), Azure, Exchange, Graph, SharePoint, Teams 등 다양한 클라우드 서비스에 PowerShell로 연결하는 방법을 정리했습니다. 최신 모듈 설치 방법과 연결 명령어를 확인하고, 효율적으로 M365 환경을 관리하세요!


1. 기본 준비 사항

PowerShell 실행

  • 관리자 권한으로 PowerShell 실행
  • 최신 버전의 PowerShell(7.x) 사용 권장

NuGet 및 PSGallery 업데이트

최신 모듈을 설치하려면 먼저 아래 명령어를 실행하세요.

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Install-PackageProvider -Name NuGet -Force
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

2. Microsoft 365 (M365) PowerShell 연결

모듈 설치

Install-Module -Name Microsoft.Graph -Scope CurrentUser

M365 연결

Connect-MgGraph -Scopes "User.Read.All","Group.Read.All"

3. Azure PowerShell 연결

모듈 설치

Install-Module -Name Az -Scope CurrentUser

Azure 로그인

Connect-AzAccount

4. Exchange Online PowerShell 연결

모듈 설치

Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser

Exchange Online 연결

Connect-ExchangeOnline -UserPrincipalName admin@domain.com

5. Microsoft Graph PowerShell 연결

모듈 설치

Install-Module Microsoft.Graph -Scope CurrentUser

Graph API 연결

Connect-MgGraph -Scopes "User.Read.All"

6. SharePoint Online PowerShell 연결

모듈 설치

Install-Module -Name Microsoft.Online.SharePoint.PowerShell -Scope CurrentUser

SharePoint 연결

Connect-SPOService -Url https://yourtenant-admin.sharepoint.com -Credential (Get-Credential)

7. Microsoft Teams PowerShell 연결

모듈 설치

Install-Module -Name MicrosoftTeams -Scope CurrentUser -Force

Teams 연결

Connect-MicrosoftTeams

8. Security & Compliance PowerShell 연결

모듈 설치

Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser

Security & Compliance Center 연결

Connect-IPPSSession -UserPrincipalName admin@domain.com

9. Intune PowerShell 연결

모듈 설치

Install-Module Microsoft.Graph.Intune -Scope CurrentUser

Intune 연결

Connect-MSGraph

10. Defender for Endpoint PowerShell 연결

모듈 설치

Install-Module -Name WindowsDefenderATP -Scope CurrentUser

Defender 연결

Connect-WindowsDefenderATP

11. Power Platform (PowerApps & Power Automate) PowerShell 연결

모듈 설치

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell -Scope CurrentUser
Install-Module -Name Microsoft.PowerApps.PowerShell -Scope CurrentUser

Power Platform 연결

Add-PowerAppsAccount

12. Yammer PowerShell 연결

모듈 설치

Install-Module -Name Microsoft.Online.Yammer.PowerShell -Scope CurrentUser

Yammer 연결

Connect-Yammer -Token YourAccessToken

💡 추가 팁

  • 연결을 해제하려면 Disconnect-ExchangeOnline, Disconnect-AzAccount 같은 명령어 사용
  • 다중 인증(MFA)이 설정된 경우, -Credential (Get-Credential) 대신 기본 Connect- 명령어를 사용하면 웹 브라우저에서 인증 진행됨
  • 최신 PowerShell 7.x 환경에서 모든 모듈이 잘 동작하는지 확인 필요

이제 PowerShell을 활용하여 M365 및 다양한 Microsoft 클라우드 서비스를 효율적으로 관리하세요! 🚀

728x90
반응형