【发布时间】:2018-10-09 23:16:08
【问题描述】:
我在安装了 MSOnline 模块的 azure AD Runbook 中运行代码:
Import-Module MSOnline
$credential = get-automationpscredential -name 'CoreyA'
Connect-MsolService -Credential $credential
但是得到以下错误:
Connect-MsolService : Unable to find an entry point named 'GetPerAdapterInfo' in DLL 'iphlpapi.dll'.
At line:3 char:1
+ Connect-MsolService -Credential $credential
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (:) [Connect-MsolService], EntryPointNotFoundException
+ FullyQualifiedErrorId :
System.EntryPointNotFoundException,Microsoft.Online.Administration.Automation.ConnectMsolService
我尝试了多种代码变体,但似乎无法在任何地方找到解决方案。当我连接到我的 run as 帐户时,该代码可以在我的本地计算机上使用 powershell ISE,但不能在 AAD 中运行。
【问题讨论】:
-
你试过这个页面的解决方案了吗:social.msdn.microsoft.com/Forums/azure/en-US/…
-
是的,它与我的代码无关,但它仍然引用相同的 .dll 文件,但他们的解决方法是使用 MSOL 在获得 365 个用户等时不支持的 api 调用
-
运行 $error[0]|format-list -force 是否会为您提供有关错误的更多信息?
-
writeErrorStream:True 异常:System.EntryPointNotFoundException:无法在 DLL“iphlpapi.dll”中找到名为“GetPerAdapterInfo”的入口点。在 Microsoft.IdentityModel.Clients.ActiveDirectory.Internal.Platform.WebUI.
d__12.MoveNext() --- 从先前引发异常的位置结束堆栈跟踪 --- 在 System.Runtime.ExceptionServices.ExceptionDispatchInfo。抛出()
标签: powershell azure-active-directory runbook azure-runbook