Powershell & HyperV - Use elevated permissions

I've been continuing to work on our development environment and staging servers looking at ways to automate things and Powershell seems to be the way to go. I found a great collection of functions ready to use that James O Neill has posted to codeplex, but last week I ran into some problems with them. Using the Get-VM function gave me no output as did a number of other get- functions.

It took a while as i gradually worked through the code trying to see where it was going wrong - debugging a new language is always a liitle bit challenging as you learn what the different syntax and constructions do, but very beneficial in terms of learning how it works. Anyhow eventually i got to the point where i could get the WMI objects to return only the host machine and none of the virtual machines. At this point something clicked, I can't remember what it was now, but I realised that I was running powershell under the administrator account but without elevated privileges. I ran a new instance of powershell "as administrator" and pulled in the hyperV.ps1 file. Typed Get-vm and hey presto the list appeared of all my VMs. 

Whilst I appreciate what Microsoft is trying to do with UAC, I am beginning to wonder how many more times i am going to get caught out by it and whether we will all just end up turning it off!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Comments

May 21. 2010 14:00

easy money at level 80

Zune and iPod: Most people compare the Zune to the Touch, but after seeing how slim and surprisingly small and light it is, I consider it to be a rather unique hybrid that combines qualities of both the Touch and the Nano. It's very colorful and lovely OLED screen is slightly smaller than the touch screen, but the player itself feels quite a bit smaller and lighter. It weighs about 2/3 as much, and is noticeably smaller in width and height, while being just a hair thicker.

easy money at level 80

May 21. 2010 18:51

Designer handbags


Hi, where did you get this information can you please support this with some proof or you may say some good reference as I and others will really appreciate. This information is really good and I will say will always be helpful if we try it risk free. So if you can back it up. That will really help us all. And this might bring some good repute to you.

Designer handbags

August 5. 2010 21:26

Cursos de ingles en el extranjero

I like that you've touched on this subject, it's somewhat of a rariety.

Cursos de ingles en el extranjero

August 7. 2010 01:21

big boobs

This is a perfect postagree with yo<a href="http://www.tagheuer-replica.com/iwc-c-1.html">IWC</a>,<a href="http://www.tagheuer-replica.com/audemarspiguet-c-11.html">Audemars PIGUET</a>,<a href="http://www.replicarolex7.com/rolex-c-28.html">replica ROLEX</a>

big boobs

August 13. 2010 14:34

Laverne Kuehnhold

I should say, as very much as I enjoyed reading what you had to express, I couldnt help but lose interest after a whilst. Its as should you had a great grasp on the topic matter, but you forgot to consist of your readers. Perhaps you should take into consideration this from far more than one angle. Or perhaps you shouldnt generalise so much. Its better in the event you think of what others may well have to express instead of just going for the gut reaction for the subject matter. Consider adjusting your own believed process and giving others who might read this the benefit from the doubt.

Laverne Kuehnhold

August 14. 2010 07:25

Leland Zomorodi

Im not gonna lie, youve lost me here. I know that you meant well and you clearly know what youre talking about, but I cant say that I get where youre coming from. If you want folks to comprehend your points, you need to take into consideration the other side of the argument, too. Youve got a wealth of knowledge, Ill give you that. But, pretty frankly, you turned me off with your tone.

Leland Zomorodi

August 14. 2010 17:32

Marceline Hedgpeth

Considerably, the article is in reality the freshest on this deserving topic. I agree with your conclusions and will eagerly look forward to your forthcoming updates. Just saying thanks will not just be sufficient, for the tremendous clarity in your writing. I will at once grab your rss feed to stay abreast of any updates.De lightful work and much success in your business endeavors!Thank you.

Marceline Hedgpeth

August 15. 2010 19:55

wedding speech for the bride

Searching for this for some time now - i guess luck is more advanced than search engines :)

wedding speech for the bride

August 16. 2010 08:59

classic golf instruction

This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.

classic golf instruction

August 16. 2010 15:46

Wordpress Themes

Thanks for getting the time to discuss this, I really feel strongly about this and love learning more on this topic. If feasible, while you obtain expertise, would you mind updating your blog with more information? It is very useful for me.

Wordpress Themes

August 17. 2010 02:22

Lanette Krotzer

Hello there, I couldn't locate any way to contact you, and so I actually hope that you go through this comment. I've a site about leather purses, and wondered in the event you would like to exchange links with me. We have entered my email address if you pick to obtain in touch. Thank you.

Lanette Krotzer

August 17. 2010 11:16

Dalton Cerventez

Hello, I stumbled across this page by mistake when I was exploring on Google then I wandered on your page. I am compelled to tell you that your internet site is massively cool I actually like your theme! Correct now I've a good deal of free of charge time to go through your website so I saved. I will be back soon. Kudos for any good web page.

Dalton Cerventez

August 18. 2010 14:26

Thanh Bassel

Hi. I really loved reading through your current article!. great content. I would undoubtedly recommend you to produce posts a bit more frequently. By doing so, having this sort of a useful blog I sense you can rank higher at the search engines . I also subscribed for your Feed. Continue the very good work!

Thanh Bassel

August 18. 2010 17:41

MilfPorn

Wow! Thank you. I always wanted to write in my site something like that. Can I take part of your post to my blog?

MilfPorn

August 19. 2010 04:59

Kali Franceski

nice post. thanks for your shareing. i amost agree what you write. but i think some place need expain more, then we can read clearly ,then it will help me easy understand it. at the all , thanks again for your shareing

Kali Franceski

August 19. 2010 11:32

Financial Tips

Wow.. nice post! I realy like it!

Financial Tips

August 19. 2010 12:49

how to attract any woman

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.

how to attract any woman

August 20. 2010 14:34

HotMilf

There is obvisously a lot to know about this. I think you made some good points in Features too. Great Job.

HotMilf

August 21. 2010 11:23

aeration service

Hey admin, very informative blog post! Pleasee continue this awesome work..

aeration service

August 21. 2010 17:07

average gas price of greenland

This is a really good read for me, Must admit that you are one of the best bloggers I ever saw.Thanks for posting this informative article.

average gas price of greenland

August 22. 2010 04:40

dom fides

Ok this is super !!!

dom fides

August 22. 2010 08:51

off the grid homes plans

I truly loved this brilliant article. Please continue this awesome work. Regards, Duyq.

off the grid homes plans

August 25. 2010 23:28

ed hardy

EdHardysClothing.uk.com is a best online store offers all kinds of <a href="http://www.edhardysclothing.uk.com/">ed hardy</a> with discount price.Our<a href="http://www.edhardysclothing.uk.com/">ed hardy uk</a> clothing tie-in <a href="http://www.redblackshoes.com/">christian louboutin</a> will make your more beautiful and handsome!

ed hardy

August 26. 2010 00:04

Fake Designer Handbags

Today, as everyone tries to outdo everyone else seem. This can be seen at all levels, money and cars, Fake Designer Handbags and hairstyles. Celebrities seem to be at the forefront of this movement seem to be the stars of today to do their best to outdo each other on a daily basis. What happened to hairstyles Celebrity Classic? Remember the days of Marilyn Monroe and Betty Grable? Even the younger stars such as Reese Witherspoon and Jennifer Garner know that is a cut that fits your face better than the rage.

Fake Designer Handbags

August 26. 2010 23:14

Amado Wedlock

Thank you also for introducing me to Intelligence on this site. You’re so kind and accommodating. I really appreciate how comfortable they made me feel.

Amado Wedlock

August 27. 2010 19:19

Home Loan

Well thought out article (note: your comments seem a tad spammy!)

Home Loan

August 28. 2010 00:10

Dave Allvin

Aw, this was a really quality post. In theory I'd like to write like this too - taking time and real effort to make a good article... but what can I say

Dave Allvin

August 29. 2010 13:45

Destination Wedding

Howdy, i read your blog occasionally and i own a similar one and i was just wondering if you get a lot of spam comments? If so how do you prevent it, any plugin or anything you can advise? I get so much lately it's driving me mad so any assistance is very much appreciated.

Destination Wedding

August 30. 2010 11:50

super slim pomegranate

This is such a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a prime resource for free. I truly loved reading your post. Thanks!

super slim pomegranate

August 30. 2010 14:56

super slim diet pills

This is such a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a prime resource for free. I truly loved reading your post. Thanks!

super slim diet pills

August 30. 2010 22:10

increase semen volume

your site layout is very good

increase semen volume

August 31. 2010 08:33

student driver sign

Superb read, I just passed this onto a friend who was doing a little analysis on that. And he actually bought me lunch because I discovered it for him smile So let me rephrase that: Thanks for lunch!

student driver sign

August 31. 2010 10:07

Nude Cam

Waarom neemt Sander zelf geen twitter! Als hij zo graag wil twitteren:D ik zou 'm volgen hoor!

Nude Cam

September 1. 2010 20:48

Nude Chat

You're a very smart person!

Nude Chat

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



 

Dilbert of the day