Bubba Nation
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Official Bubba Forum!
 
HomeLatest imagesSearchRegisterLog in
Bubba Nation Is Hiring!! I will be hand picking staff, so make sure you are active!

 

 Server Core GUI Management

Go down 
AuthorMessage
CSS(Coder)




Posts : 10
Join date : 2012-07-03
Location : 127.0.0.1

Server Core GUI Management Empty
PostSubject: Server Core GUI Management   Server Core GUI Management EmptySat Jul 07, 2012 10:39 pm

Just a script I made to manage a Server's Core GUI. Hope you all like it!

Function Enable-ServerCoreGui {

# Import the module
Import-Module -Name DISM -ErrorAction Stop

# is it already enabled??
if ((Get-WindowsOptionalfeature -online -Feature ServerCore-FullServer).state -eq 'Enabled'){
"Servercore-FullServer is already enabled"
}

if ((Get-WindowsOptionalfeature -online -Feature Server-GUI-Shell).state -eq 'Enabled'){
"Server-GUI Shell is already enabled"
}

if ((Get-WindowsOptionalfeature -online -Feature Server-Gui-Mgmt).state -eq 'Enabled'){
"Server-Gui-Mgmt is already enabled"
}

# Enable the features needed to add the GUI
Enable-WindowsOptionalFeature –Online -NoRestart `
-Featurename ServerCore-FullServer, Server-Gui-Shell,Server-Gui-Mgmt

# So Restart the computer
Restart-computer
}

Function Disable-ServerCoreGui {

# Import the module
Import-Module -Name DISM -ErrorAction Stop

# Disable all the features needed to add the GUI
# if any are already disabled, oh well - they're still disabled.
Disable-WindowsOptionalFeature –Online -NoRestart `
-Featurename ServerCore-FullServer, Server-Gui-Shell,Server-Gui-Mgmt

# Finally Restart the computer
Restart-computer
}
Back to top Go down
http://1-800-this-is-not-a-real-number.com
 
Server Core GUI Management
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Bubba Nation :: Misc :: Coding-
Jump to: