2016-09-29 7 views
0

Ich habe versucht, AD zu automatisieren, indem Sie diesen Link:Automatisieren von AD mit Azure Resource Manager

https://blogs.technet.microsoft.com/markrenoden/2016/07/26/deploying-a-dc-to-azure-iaas-with-arm-and-dsc/ 

Ich habe mit Hilfe von Vorlagen versucht, die verfügbar sind, aber ich habe ein Problem gibt. Es werden erfolgreich bereitgestellt, die Rollen sind jedoch nicht sichtbar. Nur Gruppenrichtlinienverwaltung ist sichtbar, nicht alle. Also, ich folge dem.

Dies ist der Fehler ich konfrontiert:

16:17:11 - [ERROR] Get-AzureRmEnvironment : The term 'Get-AzureRmEnvironment' is not recognized 
16:17:11 - [ERROR] as the name of a cmdlet, function, script file, or operable program. Check the 
16:17:11 - [ERROR] spelling of the name, or if a path was included, verify that the path is 
16:17:11 - [ERROR] correct and try again. 
16:17:11 - [ERROR] At line:1 char:171 
16:17:11 - [ERROR] + ... re_PS_Data_Collection = 'true' }; if ((Get-AzureRmEnvironment -Name ' ... 
16:17:11 - [ERROR] +           ~~~~~~~~~~~~~~~~~~~~~~ 
16:17:11 - [ERROR]  + CategoryInfo   : ObjectNotFound: (Get-AzureRmEnvironment:String) 
16:17:11 - [ERROR] [], CommandNotFoundException 
16:17:11 - [ERROR]  + FullyQualifiedErrorId : CommandNotFoundException 
16:17:11 - [ERROR] 
16:17:11 - [ERROR] Get-AzureRmEnvironment : The term 'Get-AzureRmEnvironment' is not recognized 
16:17:11 - [ERROR] as the name of a cmdlet, function, script file, or operable program. Check the 
16:17:11 - [ERROR] spelling of the name, or if a path was included, verify that the path is 
16:17:11 - [ERROR] correct and try again. 
16:17:11 - [ERROR] At line:1 char:2323 
16:17:11 - [ERROR] + ... '[email protected]' -Environment (Get-AzureRmEnvironment -Name ' ... 
16:17:11 - [ERROR] +           ~~~~~~~~~~~~~~~~~~~~~~ 
16:17:11 - [ERROR]  + CategoryInfo   : ObjectNotFound: (Get-AzureRmEnvironment:String) 
16:17:11 - [ERROR] [], CommandNotFoundException 
16:17:11 - [ERROR]  + FullyQualifiedErrorId : CommandNotFoundException 
16:17:11 - [ERROR] 
16:17:11 - [ERROR] & : The script 'Deploy-AzureResourceGroup.ps1' cannot be run because the 
16:17:11 - [ERROR] following modules that are specified by the "#requires" statements of the 
16:17:11 - [ERROR] script are missing: AzureRM.Resources. 
16:17:11 - [ERROR] At line:1 char:2369 
16:17:11 - [ERROR] + ... eCloud')));&'C:\Users\admin\Documents\Visual Studio 2015\Projects\MyD ... 
16:17:11 - [ERROR] +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
16:17:11 - [ERROR]  + CategoryInfo   : ResourceUnavailable: (Deploy-AzureResourceGroup. 
16:17:11 - [ERROR] ps1:String) [], ScriptRequiresException 
16:17:11 - [ERROR]  + FullyQualifiedErrorId : ScriptRequiresMissingModules 
16:17:11 - [ERROR] 
16:17:11 - 
16:17:11 - Deploying template using PowerShell script failed. 

Dann habe ich zu meinem Powershell dies getan, es zu versuchen und zu lösen. Aber nichts hat sich geändert:

Add-AzureRmAccount -Environment (Get-AzureRmEnvironment -Name AzureUSGovernment) 

Muss ich etwas zu meiner Powershell hinzufügen?

+0

Welche Version von Azure PowerShell verwenden Sie? –

+0

PS C: \ Benutzer \ admin> $ PSVersionTable.PSVersion. Dies ist der Befehl, mit dem ich die Version überprüft habe. Es zurückgegeben Major - 5, Minor --- 1, Build --- 14393, Revision --- 187 – prudhvi

+0

In Powershell-ISE konnte ich Get-AzureRmEnvironment-Modul auf der rechten Seite finden. Also, ich habe dieses Modul. Dann, warum der Fehler ?? In dem obigen Befehl gab ich den Namen AzureUSGovernment und ich betreibe meinen Einsatz in Südostasien. Kann ich das machen?? – prudhvi

Antwort

0

Für alle anderen, die auf dieses Problem stoßen, habe ich dasselbe Problem beim Ausprobieren eines Azure-Schnellstarts gefunden, weil ich die Azure PowerShell-Cmdlets nicht installiert hatte. Schritte detailliert sind here und sind:

  1. Stellen Sie sicher, die Sie installiert haben PowerShellGet, erfordert Powershell 5.x, wenn auf eine niedrigere Version benötigen Sie den PackageManagement modules

  2. die Azure Powershell Tools installieren (von innen her ein erhöhte Powershell-Fenster):

    Install-Modul AzureRM

  3. Stellen Sie sicher, Visual Studio neu zu starten, dann wiederholen Sie Ihre Azure Skript

Verwandte Themen