PowerShell AzureAD:检查是否建立了连接(使用Connect-AzureAD) [英] PowerShell AzureAD: Check if connection is established (with Connect-AzureAD)

查看:85
本文介绍了PowerShell AzureAD:检查是否建立了连接(使用Connect-AzureAD)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何通过代码检查我的PowerShell会话是否具有活动的AzureAD连接.......即。与< strong> Connect-AzureAD 命令建立的连接?

How can I by code check if my PowerShell session has an active AzureAD connection.......i.e. a connection established with the Connect-AzureAD command?

推荐答案

只需运行与该模块相关的任何cmdlet即可。我使用Get-AzureADTenantDetail cmdlet设置表示租户名称的变量,并检查其存在。
Simply run any cmdlet related to the module. I use Get-AzureADTenantDetail cmdlet to set a variable representing the tenant name, and check for its existence.


这篇关于PowerShell AzureAD:检查是否建立了连接(使用Connect-AzureAD)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆