Share via


Virtual Tech Days Sep 08 – Managing Windows Vista using Windows Powershell

 

Hi, I am Ranjana Jain (https://ranjanajain.spaces.live.com) . I was one of the presenters at the recently held Virtual Tech Days from Microsoft. I presented two sessions – a. Managing Windows Vista using Windows Powershell and b. A look at the performance changes in Windows Vista SP1. A number of questions were asked during these virtual livemeeting sessions, which may not have been answered by me primarily due to lack of time. However I feel it was important to address the queries of the attendees, so like Ravi, I too decided to do that in this blog. So here I have consolidated most of the queries asked during the sessions and have tried to provide all the info that you can benefit from.

Many more questions were also asked that may not have been articulated in the exact same words, but I am sure most of the information that was required has been provided as answers to these queries.

Q1. Can Desktop Settings of users be modified using Powershell?

Answer: Yes, Windows Powershell is a complete administrative shell using which administrators can do anything on the computer they have rights to. This includes, modifying desktop settings, starting/stopping services, changing policy settings, editing registry and even managing event logs etc. Here is a link where you can find scripts that have already been created to Manage Windows Desktop Settings: https://www.microsoft.com/technet/scriptcenter/scripts/msh/default.mspx?mfr=true .

Q2. Can we create batchfiles/scripts using Windows Powershell to automate the tasks?

Answer: Yes, infact creating scripts in Windows Powershell is much easier than creating scripts in Visual Basic, or other programming languages. All that you need to create a script for Windows Powershell is to write all the Powershell commands in a notepad as you would want to run in sequence on the Powershell, and just save the file with a “.ps1” extension i.e. <filename.ps1> . Now you just need to provide the complete path of this .ps1 script file at the Powershell prompts and execute it! -J Yippee!!

Q3. Can I activate Windows Vista using Windows Powershell?

Answer: Absolutey, infact a Powershell script already exists in our scripts database to activate Windows Vista: https://www.microsoft.com/technet/scriptcenter/scripts/msh/desktop/activate/default.mspx?mfr=true . These include scripts using which you can not only know the activation status but also use scripts to activate Windows both offline and online. -J

Q3. How do we run the Powershell batch files/scripts on remote computers?

Answer: This was demonstrated as a part of the scripts I executed during the session. As I mentioned, that in most of the commands that used GetWmiObect , I could replace the “.” value for the /computername parameter with the UNC path of the computer on which you want to execute the command.
For example: - Get-WmiObject -Class Win32_BIOS -ComputerName.
The above command displays the BIOS information on the local computer. Replacing the “.” value in the above command with the UNC path of the destination computer will display BIOS info for the destination computer.

Q4. Can we edit registry using Powershell commands?

Answer: Absolutely, infact Regedit is not required to edit registry using Windows Powershell. Windows Powershell exposes Windows Registry as a data store ( like C: and D: drives) in the form of psdrives. Therefore you can access the HKEY LOCAL MACHINE registry hive as HKLM:\ and then use usual commands to edit registry. For more information and actual commands to edit specific registry information please view the session recording at: https://www.connectwithlife.co.in/vtd/           
For Example: $value = (get-itemproperty "HKLM:\software\microsoft\internet explorer").version

Q5. Is Windows Powershell a new version of Linux shell, as you can run all Linux shell commands in Powershell?

Answer: Windows Powershell was basically developed to bridge gaps that were there wrt administration using Windows Command Line (cmd shell). We had a large number of commands to manage Windows Server 2003. Many more commands were added with Windows Server 2003 R2. But the cmd shell could still not provide the intuitiveness of Bash , the object based simplicity of Perl etc. So there was a desperate need to have an intuitive and simple command shell that could be more useful especially to administrators. Do watch/listen to this video (an interview with Jeffery Snover , Windows Powershell developer) : https://www.microsoft.com/uk/technet/spotlight/sessionh.aspx?videoid=209

Q6. How can I use Powershell to administer most activities on Windows Vista Computer?
Ans: Powershell can be used to administer Windows Vista Computers in all ways that you can do it using the GUI. Many of such administrative activities were demonstrated in the VTD session and you can even download a Powershell Owner’s manual whre you can access most of the information on how you can use it even better to administer Windows Vista: https://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/default.mspx

Q7: Are the Powershell commands same for Windows XP and Windows Vista?

Answer: Although there are many commands that might look same for both the platforms, but yet there are many differences, mostly for administering features that were not present in Windows XP.

Q8: Can existing VB scripts be used on Windows Powershell?

Answer: Before using VB scripts on Windows Powershell, you need to convert them to Powershell scripts. This is a simple task that can be done using existing tools:

https://www.microsoft.com/technet/scriptcenter/topics/winpsh/convert/default.mspx

 

Above al, you can find most of the scripts, tools, guides and resources on Powershell here:

https://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx

To learn more about working with Windows Powershell, you can also view many webcasts on Windows Powershell at: https://www.microsoft.com/webcasts

Virtual Lab on Windows Powershell can also be found at: https://msevents.microsoft.com/CUI/WebCastEventDetails.aspx?culture=en-US&EventID=1032314395&EventCategory=3 

Moreover, if you are a Windows Administrator who hates writing a script (like me -J) , please watch: https://www.microsoft.com/uk/technet/spotlight/sessionh.aspx?videoid=214&PUID=000149505AA18347

Happy Powershell Learning -J !!!

Comments

  • Anonymous
    January 01, 2003
    thank you