คำว่า 'Connect-AzureRmAccount' ไม่ได้รับการยอมรับ
โมดูล Azure PowerShell AzureRM ใช้สำหรับการจัดการและระบบอัตโนมัติของทรัพยากร Azure เช่น VM, VNets เป็นต้น
หากคุณพยายามเชื่อมต่อกับ Azure โดยไม่ต้องติดตั้งโมดูล คุณจะพบข้อความแสดงข้อผิดพลาดต่อไปนี้:
PS C:\> Connect-AzureRmAccount
Connect-AzureRmAccount : The term 'Connect-AzureRmAccount' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included,
verify that the path is correct and try again.
At line:1 char:1
+ Connect-AzureRmAccount
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-AzureRmAccount:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
เพื่อแก้ไขปัญหานี้ คุณต้องติดตั้งโมดูล AzureRm PowerShell
ข้อกำหนดเบื้องต้นของ AzureRM
มีข้อกำหนดเบื้องต้นหลายประการที่ต้องปฏิบัติตามก่อนที่คุณจะสามารถติดตั้งโมดูล AzureRm PowerShell ได้สำเร็จ:
- โมดูล AzureRm สร้างขึ้นบน .Net Framework ดังนั้นจึงต้องมีโมดูลนี้อยู่ ตรวจสอบให้แน่ใจว่าคุณมีเวอร์ชัน 4.7.2 หรือใหม่กว่า ติดตั้งจากที่นี่หากจำเป็น
- คุณต้องมี PowerShell เวอร์ชัน 5.1 หรือใหม่กว่า ตรวจสอบเวอร์ชันของคุณโดยใช้คำสั่งต่อไปนี้:
PS C:\> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 17763 771
- หากไม่มี PowerShell เวอร์ชัน 5.1 คุณสามารถติดตั้งได้จากที่นี่
PS C:\> Get-PackageProvider
Name Version DynamicOptions
---- ------- --------------
msi 3.0.0.0 AdditionalArguments
msu 3.0.0.0
NuGet 2.8.5.208 Destination, ExcludeVersion, Scope, SkipDependencies, Headers, ...
PowerShellGet 1.0.0.1 PackageManagementProvider, Type, Scope, AllowClobber, ...
Programs 3.0.0.0 IncludeWindowsInstaller, IncludeSystemComponent
- หากไม่มี NuGet คุณสามารถติดตั้งได้โดยใช้คำสั่งต่อไปนี้:
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Forceการติดตั้งโมดูล Azure PowerShell AzureRM
หากตรงตามข้อกำหนดเบื้องต้นทั้งหมด คุณสามารถติดตั้งโมดูล AzureRm PowerShell ได้โดยใช้คำสั่งต่อไปนี้:
Install-Module AzureRmเมื่อการติดตั้งเสร็จสมบูรณ์ คุณควรจะสามารถเชื่อมต่อได้สำเร็จโดยใช้โมดูล AzureRm:
PS C:\> Connect-AzureRmAccount
Account SubscriptionName TenantId Environment
------- ---------------- -------- -----------
admin@easy365manager.com Pay-As-You-Go c1493123-2ba6-a49e-b462-e3e7cdbae630 AzureCloud
สรุป
หวังว่าโพสต์นี้จะช่วยให้คุณเริ่มต้นใช้งานโมดูล AzureRm PowerShell ได้
หากคุณกำลังมองหาวิธีที่ง่ายและสะดวกในการจัดการผู้ใช้ Office 365 กล่องจดหมาย และสิทธิ์การใช้งาน โปรดดูที่ Easy365Manager
ด้วย Easy365Manager คุณสามารถจัดการรายวันทั้งหมดภายในเครื่องมือผู้ใช้ AD และคอมพิวเตอร์ โดยไม่ต้องสลับระหว่างพอร์ทัล Office 365, Exchange Admin Center และ PowerShell อย่างต่อเนื่อง
Easy365Manager เปิดให้ทดลองใช้งานเต็มรูปแบบเป็นเวลา 30 วัน
