Welcome!

Industrial IoT Authors: Yeshim Deniz, Liz McMillan, Elizabeth White, Stackify Blog, SmartBear Blog

Related Topics: Microsoft Cloud, Industrial IoT, Microservices Expo, Open Source Cloud, Containers Expo Blog, Silverlight, Cloud Security

Microsoft Cloud: Blog Post

Use PowerShell to Add New Managed Servers in Windows Server 2012

PowerShell 3.0 in Windows Server 2012 provides automated management

When I’m speaking with IT Pros about the great multi-server management enhancements in Windows Server 2012, I’m frequently asked about ways in which servers can be programmatically added to the new Server Manager tool.  This can be very useful when building many new servers and you’d like to make sure they are all added into the Server Manager console in an automated fashion.  In this article, we’ll step through the method of doing exactly this with PowerShell 3.0 and Server Manager together.

image

Where does Server Manager store its list of Managed Servers?
Before we can programmatically add new servers to the list of managed servers in Server Manager, we first need to understand how Server Manager stores the list of servers it is managing.   When adding servers to Server Manager, the name of each managed server is stored in the following XML configuration file:

C:\Users\[Username]\AppData\Roaming\Microsoft\Windows\ServerManager\ServerList.xml

Since this XML file is stored inside each user’s profile in the “Roaming” folder, by default this file will roam across management workstations if roaming user profiles are configured via Active Directory.

This XML file has a very simple structure consisting of a top-level ServerList node with child ServerInfo elements for individual servers, child ServerGroupInfo elements for custom groups that have been added to Server Manager, and child ServerGroupMembership elements for members of each custom group.

image

Sample ServerList.xml Configuration File

Thankfully, XML files can be easily processed by PowerShell 3.0 and we’ll use this capability to programmatically add new servers into the list of managed servers for Server Manager.

Getting Started …
To work through these steps together, you’ll need Windows Server 2012 to be already installed and accessible.  If you don’t yet have a lab environment running Windows Server 2012, check out our “Early Experts” program for some really easy methods to build a Windows Server 2012 lab in your on-premises environment or in the cloud using Windows Azure Infrastructure Services.

Step 1 - Close Server Manager before updating ServerList.xml
When Server Manager is running, it is continuously reading and writing information to the ServerList.xml file.  When updating this file outside of the Server Manager tool, you’ll want to make sure Server Manager is closed so that it’s not reading and writing to this file at the same time as your own updates.

To programmatically close Server Manager in your PowerShell script prior to making any updates to the ServerList.xml file, use the following PowerShell code:

get-process ServerManager | stop-process –force

Step 2 – Set path of existing ServerList.xml file
The ServerList.xml file is located in a rather lengthy path that is stored on a per-user basis.  Let’s set a variable to make it easy to reference the path to this file in our PowerShell script.

$file = get-item "$env:USERPROFILE\AppData\Roaming\Microsoft\Windows\ ServerManager\ServerList.xml"

Step 3 – Backup ServerList.xml
Improper direct modification of ServerList.xml can render this file unusable by Server Manager, so be sure to make a backup copy of this file before proceeding.

copy-item –path $file –destination $file-backup –force

Step 4 – Get content from ServerList.xml file in XML format
Next, we’ll grab the XML content from the ServerList.xml and store it in a PowerShell variable using the get-content cmdlet.

$xml = [xml] (get-content $file )

Step 5 – Clone an existing managed server element to a new XML element
Using the PowerShell clone() method for an existing XML element, we can create a new ServerInfo element that we can then update with the unique values for our new managed server entry in Server Manager.

$newserver = @($xml.ServerList.ServerInfo)[0].clone()

Step 6 – Update the new cloned element with new server information
Once we’ve cloned a new ServerInfo element, we can then easily update the new element to include the information that is related to our new managed server entry in Server Manager.

$newserver.name = “servername.domain.com”

$newserver.lastUpdateTime = “0001-01-01T00:00:00”

$newserver.status = “2”

Step 7 – Append the new cloned element inside the ServerList node
The new cloned element is now updated to reflect our new server information, so we’ll now append this cloned element to the existing list of servers stored inside the ServerList node that we previously read from ServerList.xml.

$xml.ServerList.AppendChild($newserver)

Step 8 – Save the updated XML elements to ServerList.xml
After appending the new ServerInfo element inside the ServerList node, we’ll commit the changes to the ServerList.xml file using the PowerShell save()method.

$xml.Save($file.FullName)

Step 9 – Re-launch Server Manager to see the results
We’ve completed the process to add a new managed server to the ServerList.xml file.  Now, let’s re-launch Server Manager so that we can see our results.

start-process –filepath $env:SystemRoot\System32\ServerManager.exe –WindowStyle Maximized

Completed! What’s Next?
Continue learning about all of the great new end-to-end enhancements in Windows Server 2012, Server Manager and PowerShell 3.0 by joining our FREE “Early Experts” online study group.  You can be our next “Early Expert”!

WS2012EE-Apprentice-Sample

You can be our next “Early Expert”!

More Stories By Keith Mayer

Keith Mayer is a Technical Evangelist at Microsoft focused on Windows Infrastructure, Data Center Virtualization, Systems Management and Private Cloud. Keith has over 17 years of experience as a technical leader of complex IT projects, in diverse roles, such as Network Engineer, IT Manager, Technical Instructor and Consultant. He has consulted and trained thousands of IT professionals worldwide on the design and implementation of enterprise technology solutions.

Keith is currently certified on several Microsoft technologies, including System Center, Hyper-V, Windows, Windows Server, SharePoint and Exchange. He also holds other industry certifications from IBM, Cisco, Citrix, HP, CheckPoint, CompTIA and Interwoven.

Keith is the author of the IT Pros ROCK! Blog on Microsoft TechNet, voted as one of the Top 50 "Must Read" IT Blogs.

Keith also manages the Windows Server 2012 "Early Experts" Challenge - a FREE online study group for IT Pros interested in studying and preparing for certification on Windows Server 2012. Join us and become the next "Early Expert"!

@ThingsExpo Stories
Nordstrom is transforming the way that they do business and the cloud is the key to enabling speed and hyper personalized customer experiences. In his session at 21st Cloud Expo, Ken Schow, VP of Engineering at Nordstrom, will discuss some of the key learnings and common pitfalls of large enterprises moving to the cloud. This includes strategies around choosing a cloud provider(s), architecture, and lessons learned. In addition, he’ll go over some of the best practices for structured team migrat...
SYS-CON Events announced today that Taica will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Taica manufacturers Alpha-GEL brand silicone components and materials, which maintain outstanding performance over a wide temperature range -40C to +200C. For more information, visit http://www.taica.co.jp/english/.
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
Recently, REAN Cloud built a digital concierge for a North Carolina hospital that had observed that most patient call button questions were repetitive. In addition, the paper-based process used to measure patient health metrics was laborious, not in real-time and sometimes error-prone. In their session at 21st Cloud Expo, Sean Finnerty, Executive Director, Practice Lead, Health Care & Life Science at REAN Cloud, and Dr. S.P.T. Krishnan, Principal Architect at REAN Cloud, will discuss how they bu...
Coca-Cola’s Google powered digital signage system lays the groundwork for a more valuable connection between Coke and its customers. Digital signs pair software with high-resolution displays so that a message can be changed instantly based on what the operator wants to communicate or sell. In their Day 3 Keynote at 21st Cloud Expo, Greg Chambers, Global Group Director, Digital Innovation, Coca-Cola, and Vidya Nagarajan, a Senior Product Manager at Google, will discuss how from store operations...
As hybrid cloud becomes the de-facto standard mode of operation for most enterprises, new challenges arise on how to efficiently and economically share data across environments. In his session at 21st Cloud Expo, Dr. Allon Cohen, VP of Product at Elastifile, will explore new techniques and best practices that help enterprise IT benefit from the advantages of hybrid cloud environments by enabling data availability for both legacy enterprise and cloud-native mission critical applications. By rev...
Join IBM November 1 at 21st Cloud Expo at the Santa Clara Convention Center in Santa Clara, CA, and learn how IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Cognitive analysis impacts today’s systems with unparalleled ability that were previously available only to manned, back-end operations. Thanks to cloud processing, IBM Watson can bring cognitive services and AI to intelligent, unmanned systems. Imagine a robot vacuum that becomes your personal assistant tha...
SYS-CON Events announced today that Datera will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Datera offers a radically new approach to data management, where innovative software makes data infrastructure invisible, elastic and able to perform at the highest level. It eliminates hardware lock-in and gives IT organizations the choice to source x86 server nodes, with business model option...
With major technology companies and startups seriously embracing Cloud strategies, now is the perfect time to attend 21st Cloud Expo October 31 - November 2, 2017, at the Santa Clara Convention Center, CA, and June 12-14, 2018, at the Javits Center in New York City, NY, and learn what is going on, contribute to the discussions, and ensure that your enterprise is on the right path to Digital Transformation.
Infoblox delivers Actionable Network Intelligence to enterprise, government, and service provider customers around the world. They are the industry leader in DNS, DHCP, and IP address management, the category known as DDI. We empower thousands of organizations to control and secure their networks from the core-enabling them to increase efficiency and visibility, improve customer service, and meet compliance requirements.
Digital transformation is changing the face of business. The IDC predicts that enterprises will commit to a massive new scale of digital transformation, to stake out leadership positions in the "digital transformation economy." Accordingly, attendees at the upcoming Cloud Expo | @ThingsExpo at the Santa Clara Convention Center in Santa Clara, CA, Oct 31-Nov 2, will find fresh new content in a new track called Enterprise Cloud & Digital Transformation.
SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp emp...
Smart cities have the potential to change our lives at so many levels for citizens: less pollution, reduced parking obstacles, better health, education and more energy savings. Real-time data streaming and the Internet of Things (IoT) possess the power to turn this vision into a reality. However, most organizations today are building their data infrastructure to focus solely on addressing immediate business needs vs. a platform capable of quickly adapting emerging technologies to address future ...
SYS-CON Events announced today that Avere Systems, a leading provider of hybrid cloud enablement solutions, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere Systems was created by file systems experts determined to reinvent storage by changing the way enterprises thought about and bought storage resources. With decades of experience behind the company’s founders, Avere got its ...
SYS-CON Events announced today that Avere Systems, a leading provider of enterprise storage for the hybrid cloud, will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Avere delivers a more modern architectural approach to storage that doesn't require the overprovisioning of storage capacity to achieve performance, overspending on expensive storage media for inactive data or the overbui...
SYS-CON Events announced today that IBM has been named “Diamond Sponsor” of SYS-CON's 21st Cloud Expo, which will take place on October 31 through November 2nd 2017 at the Santa Clara Convention Center in Santa Clara, California.
SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
High-velocity engineering teams are applying not only continuous delivery processes, but also lessons in experimentation from established leaders like Amazon, Netflix, and Facebook. These companies have made experimentation a foundation for their release processes, allowing them to try out major feature releases and redesigns within smaller groups before making them broadly available. In his session at 21st Cloud Expo, Brian Lucas, Senior Staff Engineer at Optimizely, will discuss how by using...
In this strange new world where more and more power is drawn from business technology, companies are effectively straddling two paths on the road to innovation and transformation into digital enterprises. The first path is the heritage trail – with “legacy” technology forming the background. Here, extant technologies are transformed by core IT teams to provide more API-driven approaches. Legacy systems can restrict companies that are transitioning into digital enterprises. To truly become a lead...