-
-
Save kamimori-kosuke-fixer/db04a30de10dea055c9882da17e1827d to your computer and use it in GitHub Desktop.
Simple guest status check(Azure AD)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 検索したいメールアドレスを入れる | |
$mail = "hogehoge@fixer.com" | |
# AzureADに接続する | |
Connect-AzureAD | |
# 無限ループ:ループを止めたいときはCtrl+Cを押下 | |
while(1){ | |
$user=Get-AzureADUser -Filter "mail eq '$mail'" | |
switch($user.UserState){ | |
{$_ -eq "PendingAcceptance"}{ | |
Write-Host (get-date)":`tゲストはまだ参加していません。中断する場合はCtrl+Cを押下してください。" | |
} | |
{$_ -eq "Accepted"}{ | |
Write-Host (get-date)":`t対象のゲストユーザーが参加しました。ゲストとのやり取りが開始できます。" | |
break | |
} | |
} | |
# 待機(10秒) | |
Start-Sleep -Seconds 10 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment