Posts mit dem Label Remote Management werden angezeigt. Alle Posts anzeigen
Posts mit dem Label Remote Management werden angezeigt. Alle Posts anzeigen

Donnerstag, 11. November 2010

Configuring Remote Management of Hyper-V Server - in a workgroup


I have received a number of questions about how to go about setting up remote management of our free Hyper-V server (not the one that is part of Windows).  So I thought I would sit down and write up a set of blog posts to talk about how to do this.  Today I am going to talk about how to remotely manage a Hyper-V server from a Windows 7 desktop when in a workgroup environment.
I am going to assume that you have already installed Hyper-V server and have configured the server name, workgroup name and networking appropriately (in my case – the server name is “Server1” and the workgroup name is “WORKGROUP” – not very original, I know).  Also, I am not going to be talking about the other aspects of setting up a Hyper-V server (e.g. configuring automatic updates, enabling remote desktop, etc…).  I am just focusing on how to get remote management working.
Server Configuration
The first thing you will need to do is to go to the Hyper-V server and run SConfig.cmd (this is configured to run automatically when you log into a Hyper-V server – if you have changed this you can start it manually.  It is in the Windows\System32 folder on the server).  Once you are in SConfig.cmd you will need to:

  1. Select option 4 on the SConfig menu (labeled Configure Remote Management)
  2. Then select options 1 (Allow MMC Remote Management) and 2 (Enable Windows PowerShell)

    image
  3. After you enabled Windows PowerShell you will be asked to reboot.
  4. After the reboot – go back into SConfig and select option 4 again
  5. Select option 3 (Allow Server Manager Remote Management)
    1. Note that Server Manager Remote Management requires that you have PowerShell enabled first – so you cannot shuffle this ordering around to try and avoid the reboot.
  6. Select option 5 to Return to main menu
Next, I am going to assume that you are not logged into your Windows 7 computer with the “Administrator” account (which is disabled by default) so you will need to create a second account on the Hyper-V Server.  To do this you will need to go into SConfig and:
  1. Select option 3 (Add Local Administrator)
  2. When prompted for an account name – enter the user name that you are using on the Windows 7 desktop (in my case – “Benjamin”).
  3. You will then be asked for a password – and again you should use the same password as you are using on the Windows 7 desktop (no – I am not going to tell you my password)

    image
Next – to enable remote (but read-only) access with device manager – run this command from the command prompt as well: reg add HKLM\Software\Policies\Microsoft\Windows\DeviceInstall\Settings /v AllowRemoteRPC /t reg_dword /d 1 (once again that is a single command).
image
Finally you will need to restart the server one last time (you can use option 13 on the Sconfig menu).
Desktop Configuration
Now it is time to go and configure the desktop computer.
The first thing to do is to download and install the Remote Server Administration Toolkit.  You can download it from here: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=7d2f6ad7-656b-4313-a005-4e344e43997d and install it by just running it and following the prompts.
After you have done this you will need to enable the correct remote management tools.  To do this:
  1. Open the Start menu
  2. Open Control Panel
  3. Select Programs and Features (or just Programs depending on the Control Panel view that you are using)
  4. Select Turn Windows features on or off
  5. Find Remote Server Administration Tools and Check Hyper-V Tools (under Role Administration Tools) and Server Manager under the top level list
  6. Click OK
image
In most workgroup configurations you will not have reliable name resolution for remote computers (i.e. you need to use the IP address).  However – many of the server management tools require that name resolution be working reliably.  If you are using a fixed IP address on the Hyper-V server – you can make this work by editing the “hosts” on the desktop computer (note – you can skip this step if you can ping the Hyper-V server using its name and have it resolve to an IP address correctly):
  1. Open the Start menu
  2. Click on All Programs and then on Accessories
  3. Right click on Notepad and select Run as administrator
  4. Once Notepad has opened, use the File menu to Open… a file
  5. Navigate to the “Windows\System32\Drivers\etc” folder on the system drive
  6. Change the file name option from Text Documents (*.txt) to All Files
  7. Open the “hosts” file
  8. At the end of this file – add an entry for your server.  The format is basically the IP address of the server followed by the name of the server.
  9. Save the file and exit Notepad.
(Here is the hosts file from my desktop – after I have modified it for my server)
image
You will need to enable the use of WinRM to connect to your Hyper-V server.  To do this you will need to:
  1. Open the Start menu
  2. Click on All Programs and then on Accessories
  3. Right click on Command Prompt and select Run as administrator
  4. Type in winrm quickconfig and hit enter.  You will then need to say ‘y’ (yes) to a couple of prompts
  5. Type in winrm set winrm/config/client @{TrustedHosts="RemoteComputerName"} and hit enter
    1. Substitute “RemoteComputerName” with the name or IP address of your Hyper-V server.  In my test environment my desktop computer could not resolve the name of my server – so I just opted to use the IP address.  I could also have edited the hosts file on my desktop and used the server name.
  6. While we are here – we should also open the firewall on the client side to allow us to remotely manage the servers storage by running this command: netsh advfirewall firewall set rule group="Remote Volume Management" new enable=yes
image
Now you will need to use HVRemote to enable remote management of Hyper-V on the desktop computer.
  1. Download HVRemote from http://code.msdn.microsoft.com/HVRemote/Release/ProjectReleases.aspx
  2. Open the Start menu
  3. Click on All Programs and then on Accessories
  4. Right click on Command Prompt and select Run as administrator
  5. Change to the directory where you saved HVRemote
  6. Type in cscript hvremote.wsf /mode:client /anondcom:grant /firewallhypervclient:enable /mmc:enable and hit enter.
image
You can now open Server Manager on the desktop computer.  To do this:
  1. Open the Start menu
  2. Click on All Programs and then on Administrative Tools
  3. Click on Server Manager
  4. You will be automatically prompted for the name of the server that you want to connect to.
After you enter your server name – you should have full access to manage your Hyper-V server:
image
The only caveat here is that Performance monitor still connects to the local computer.  You can, however, add individual counters from the remote server one at a time.  One thing that tripped me up on this issue is that after entering the server name you need to select the Select counters from computer: drop down and hit enter:
image

Freitag, 8. Oktober 2010

Hyper-V Server mit Windows 7 RC Client


Dieser Post wird sicher länger….
  • Los gehts mit der Hardware: Ein Server mit 4 GB RAM und einen Quad-Core XEON (E5310) Prozessor. Im BIOS die “Virtualisation Technology” Option aktivieren.
  • Von der Microsoft Website den kostenfreien Hyper-V Server 2008 R2 herunterladen und auf DVD brennen und installieren.
  • Erste Falle: Für die erste Anmeldung nach der Installation als Benutzername “Administrator” und kein Kennwort eingeben. Im nächsten Bildschirm wird man dann aufgefordert ein Kennwort für den Administrator-Account zu vergeben.
  • Es wird ein leerer Desktop mit einem schwarzen Fenster (normale “Eingabeaufforderung”) und einem blauen Fenster (verfügbare Hyper-V Server Befehle) angezeigt. In dem blauen Fenster Arbeitsgruppen-Name (ich habe den Server nicht in die Domain gehängt) und Computername anpassen sowie Remotedesktop aktivieren.
  • Am Client erst mal Windows 7 RC (32 Bit) herunterladen. Da ich hier an einem Mac sitze, habe ich mit Parallels eine neue virtuelle Maschine direkt aus der heruntergeladenen ISO-Datei installiert. “Parallels Tools” installiert und Windows Update laufen gelassen.
  • Um der Userproblematik aus dem Weg zu gehen habe ich Server und Client in die gleiche Arbeitsgruppe gehängt und melde mich jeweils mit dem Benutzer “Administrator” (dieser Benutzer ist unter Windows 7 standardmäßig deaktiviert) und dem gleichen Kennwort lokal an.
  • Über die “Remotedesktopverbindung” kann man jetzt auf den Hyper-V Server zugreifen. Natürlich bekommt man auch auf diesem Weg nur die beiden oben erwähnten schwarzen und blauen Fenster zu sehen.
  • Um den Hyper-V Server administratieren zu können, müssen als Erstes die “Remote Server Administration Tools (RSAT) for Windows 7 RC” installiert werden. Das Problem hier war es, den Download zu finden. Alle im Netz gefundenen Links zeigen auf den Download für die Beta-Version von Windows 7, und den gibt es nicht mehr. Aber ich habe ihn gefunden! Wenn der Installer gelaufen ist, kann man über “Systemsteuerung – Programme – Windows Features aktivieren” und dann “Remoteserver-Verwaltungstools – Rollenverwaltungstools” die “Hyper-V Tools” hinzufügen.
  • Jetzt fehlen noch einige Berechtigungseinstellungen, die von John Howard (Microsoft) ausführlich in seinem Blog beschrieben werden. Um dieses ziemlich komplexe Thema zu vereinfachen, hat er ein Script(Version 0.7) geschrieben, das auf dem Server (z.B. per USB-Stick) und auf dem Client ausgeführt werden kann. Mit “cscript HVRemote.wsf /show” kann man sich jeweils die aktuelle Konfiguration anzeigen lassen. Dabei werden am Ende auf gleich Hinweise auf Konfigurationsprobleme angezeigt. Bei mir mussten am Server keine, am Client hingegen gleich zwei Änderungen vorgenommen werden: “cscript HVRemote.wsf /mmc:enable” und “cscript HVRemote.wsf /anondcom:grant”. Danach den Client neu starten.
  • Jetzt kann über das Startmenü der “Hyper-V Manager” gestartet werden. Darin dann mit “Verbindung mit einem Server herstellen…” eben dies tun, wobei auch hier wieder eine böse Falle lauert: Der Zugriff über die IP-Adresse klappt nicht, es muß hier der Servername verwendet werden!
  • Dann zuerst über “Manager für virtuelle Netzwerke…” ein neues virtuelles Netzwerk definieren und mit diesem dann über “Neu – Virtueller Computer…” einen neuen virtuellen Computer erstellen.
  • Windows Server 2008 Standard x64 lies sich so problemlos installieren, aber die virtuelle Netzwerkkarte wurde nicht erkannt. Es wurden diverse Geräte mit Ausrufezeichen im Gerätemanager angezeigt. Dieses Problem lässt sich durch Ausführen des Befehls “Installationsdatenträger für Integrationsdienste einlegen” im Menü “Aktion” des Hyper-V-Managers beheben. Der Installer läuft durch, die virtuelle Machine startet neu und schon gibt es keine unbekannte bzw. problematische Hardware mehr!
  • Zurück zum Hyper-V-Server. Wie administriert man so einen Core Server? Eigentlich ganz einfach, indem man an einem anderen PC  in der Computerverwaltung (rechte Maustaste auf Arbeitsplatz – Verwalten) über den Befehl “Verbindung mit anderem Computer herstellen …” (im Menü “Aktion”) den Hyper-V-Server lädt. Nur klappt das erst mal nicht, weil die Firewall am Hyper-V-Server diesen Zugriff nicht zulässt.
  • Daniel Petri hat auf seiner sehr guten Website beschrieben, wie man am Hyper-V-Server über die Command Line die entsprechende Firewall-Regelgruppe aktiviert. Nur heißt die Gruppe auf einem deutschen Server anders und auf der Website werden im Text geschweifte Anführungszeichen verwendet, die beim simplen Kopieren zu Fehlermeldungen führen! Hier der korrekte Befehl:
    Netsh advfirewall firewall set rule group=”Remoteverwaltung” new enable=yes
    Auf seiner Website beschreibt Petri auch, wie man nach Eingabe von
    netsh advfirewall set currentprofile settings remotemanagement enable
    die Firewall auf dem Hyper-V-Server von Remote administriert, aber diese Option habe ich aus Sicherheitsgründen wieder deaktiviert.
  • Damit kann man in der Computerverwaltung auf fast alle Funktionen des Hyper-V-Servers zugreifen. Was so noch nicht funktioniert ist der Gerätemanager. Dazu muss auf dem Hyper-V-Server eine lokale Policy (Computerkonfiguration – Administrative Vorlagen – System – Geräteinstallation – Allow remote access to the Plug and Play interface) gesetzt werden, was von einem Remotesystem aus mit MMC Snap In “Gruppenrichtlinienobjekt-Editor” einfach möglich ist.


Disabling the firewall in Windows Server 2008 Core Edition


For Windows Server 2008’s Core Edition, the default firewall configuration is one of the things most administrators want to turn off after installation. You can complete this task with one line of code, which you’ll want to add to your script arsenal.
—————————————————————————————————————
The use cases for Windows Server 2008 Core Edition include additional security for certain installation sites and networks, and certain products (e.g., the free Hyper-V role) are only available on core editions. In Windows Server 2008 systems, including the core installations, the Windows Firewall is enabled by default. For many administrators, the first step of a new Windows installation is to disable the Windows Firewall. You can do this with the following Netsh command:
[netsh advfirewall set allprofiles state off]
Now the Windows Firewall is disabled for all network profiles. You can tweak the parameters to within what is run from Netsh. To determine what commands are available for Netsh, simply go into Netsh and enter a question mark (?) in one of the interactive contexts. Figure A shows the advfirewall context.
Figure A
Figure A
Visit TechNet for more information about Netsh in the advfirewall context.


Remote Management with Server Manager



Applies To: Windows Server 2008 R2
In Windows Server® 2008 R2, you can use Server Manager to perform some management tasks on remote computers. To manage a computer remotely by using Server Manager, you connect Server Manager to a remote computer in the same manner you would connect Microsoft Management consoles (MMCs) for other technologies.

Supported remote management scenarios

The following remote management scenarios are supported from Server Manager in Windows Server 2008 R2.
  • Server to server   Server Manager on a full installation of Windows Server 2008 R2 can be used to manage roles and features that are installed on another server that is running Windows Server 2008 R2.
  • Server to Server Core   Server Manager on a full installation of Windows Server 2008 R2 can be used to manage roles and features that are installed on a Server Core installation of Windows Server 2008 R2.
  • Client to server   Server Manager is installed as part of Remote Server Administration Tools on a computer that is running Windows® 7. This can be used to manage roles and features on a computer that is running either the full or Server Core installations of Windows Server 2008 R2.



If you are managing a remote computer from a computer that is running Windows 7, start the Windows Remote Management (WinRM) service to allow for the addition of trusted hosts. Open a Command Prompt session with elevated user rights by clicking Start, clicking All Programs, clicking Accessories, right-clicking Command Prompt, and then clicking Run as administrator. Type the following, and then press Enter: net start winrm
For remote connections in a Workgroup to Workgroup/Domain scenario, the remote computer must be added to the trusted hosts list on the source computer. To do this, run the following command on the source computer in a Command Prompt window that is opened with elevated user rights.
winrm set winrm/config/client @{TrustedHosts="RemoteComputerName"}
For remote connections in a Workgroup to Workgroup/Domain scenario, if a user is not logged on by using the source computer’s built-in administrator account, the following WinRM registry key must be configured to allow remote access from the source computer. This change is required because of a User Account Control (UAC) limitation on non-administrator accounts that are members of the Administrators group. To change this registry key, run the following command on the source computer at a command prompt that is opened with elevated user rights.
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
By default, WinRM allows for a maximum of five connections to a remote computer to be active per user. To increase the limit, run the following command on the source computer, in which X represents the number of connections that you want to allow, at a command prompt that is opened with elevated user rights.
winrm s winrm/config/winrs @{MaxShellsPerUser="X"}



To configure Server Manager remote management by using Windows PowerShell
  1. On the computer that you want to manage remotely, open a Windows PowerShell session with elevated user rights. To do this, click Start, click All Programs, click Accessories, click Windows PowerShell, right-click the Windows PowerShellshortcut, and then click Run as administrator.
  2. In the Windows PowerShell session, type the following, and then press Enter.
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  3. Type the following, and then press Enter to enable all required firewall rule exceptions.
    Configure-SMRemoting.ps1 -force -enable
To configure remote management on the Server Core installation option of Windows Server 2008 R2
  1. On the computer that you want to manage remotely, at the command prompt that opens by default when a member of the Administrators group logs on to the computer that is running the Server Core installation option of Windows Server 2008 R2, type the following, and then press Enter.
    Dism.exe /Online /Enable-Feature /FeatureName:NetFx2-ServerCore /FeatureName:MicrosoftWindowsPowerShell /FeatureName:ServerManager-PSH-Cmdlets /FeatureName:BestPractices-PSH-Cmdlets
  2. After the installation has completed, close all applications, and then restart the computer.
    To verify that Windows PowerShell and cmdlets for Server Manager and Best Practices Analyzer are installed, try entering the oclist command, which returns a list of all Windows features that are installed on the computer.
  3. After the operating system has finished loading, log on to the computer as, at minimum, a member of the local Administrators group.
  4. In the Command Prompt window that opens after you have logged on to the computer, type the following to open a Windows PowerShell session, and then press Enter.
    powershell
  5. In the Windows PowerShell session, type the following, and then press Enter.
    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
  6. Type the following, and then press Enter to enable all required firewall rule exceptions.
    Configure-SMRemoting.ps1 -force -enable

Rename Onedrive Business root folder

Rename Onedrive Business root folder Here is what I remember: In the Office 365 web admin pages, change the organization name to a shorte...