Tag Archive for PowerShell 4.0

Setting up a Powershell Remote admin desktop

In this post i will go through how i normally setup my PC when it is freshly installed.

  1. Install Remote Server Administration Tools (RSAT)
  2. Enable features needed on your PC in order to do remote adminstration
  3. Install Quest/Dell Powershell Commands for Active Directory (ActiveRoles)
  4. Install other 3rd part tools for PowerShell e.g. VM-PowerCli. it all comes down to what you need.
  5. Powershell Execution policy
  6. Import (enable) the needed cmdlets (activedirectory, quest etc. etc.)

1. Install Remote Server Administration Tools (RSAT)
Remember to download the version suited for your OS (32/64bit)
When Downloaded, open the downloaded file and install.
If you plan to install frequently, i recommend making a silent install, which can be archived by doing this command:
wusa.exe "Insert MSU filename e.g.:Windows6.2-KB2693643-x64.msu" /quiet /norestart

2. Enable features needed on your PC in order to do remote adminstration
Features can be added via Programs and features Gui or as i prefer via a cmd line.
As i often end up in (re-)installing a PC, this task is as easy as running a cmd file. The cmd file includes the following lines, whic i need. You might not need all of these, so feel free to remove those things you don’t need.

EnableFeatures.cmd (should be run in elevated mode)
dism /online /enable-feature /featurename:RemoteServerAdministrationTools
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-AD
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-AD-DS
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-AD-DS-SnapIns
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-AD-DS-NIS
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-AD-LDS
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-AD-Powershell
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-AD-DS-AdministrativeCenter
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-DHCP
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-DNS
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-RDS
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Features
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Features-GP
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-FileServices
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-FileServices-Dfs
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-FileServices-Fsrm
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Roles-FileServices-StorageMgmt
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-ServerManager
dism /online /enable-feature /featurename:RemoteServerAdministrationTools-Features-BitLocker

Should you need to see what features that are available on your system, then run this from a elevated cmd prompt: dism /online /get-features

I will skip Step 3 and 4 in this case, as it is pretty straight forward, download what you need, click and install.

5. PowerShell Execution policy
You need to figure out what limits you want on your system when it comes to executing PowerShell scripts.
TechNet have an article for execution policy for PowerShell 1.0 here.
And an article for execution policy for PowerShell 4.0 here.
For my own use i normally set the execution policy to Unrestricted, but have in mind that i don’t just download a script from the internet and fire it off without checking what it will do to my systems first.

Set-ExecutionPolicy -ExecutionPolicy 'Unrestricted'

6. Import (enable) the needed cmdlets (activedirectory, quest etc. etc.)
First you need to figure out what modules you have on your system, from a PowerShell prompt run this command.

Get-Module -ListAvailable

If you find that you have the needed modules on the list, then you can import them by using:

Import-Module 'ModuleName'

As the Quest ActiveDirectory Tool is a Snapin, it is imported a bit differently.

Add-PSSnapin 'SnapinName'

When these steps have been completed, you should be ready to go.

Happy Scripting 🙂

PowerShell ISE on steroids

As many other PowerShellers i recieve a frequent newsletter from PowerShellMagazine.com the newsletter is bits and pieces from the PowerShell comunity. here the other day when i got the mail there was a link to an article about “ISESteroids – A Revolutionary PowerShell ISE Add-On” which instantly caught my eye and attention.

ISESteroids is a plugin for PowerShell ISE made by PowerShell MVP Tobias Weltner. The plugin gives you a lot of extra features to your PowerShell ISE, unfortunately there is a cost related to the plugin, which might scare of potential users. You can get a trial version here.

Read more about the plugin on either powershell.com or the article i read and liked better on powershellmagazine.com.

Enjoy scripting