Running Windows PowerShell as Any User

So I have a need to login to other PCs through Windows PowerShell from time to time. Just like I need to SSH to other Linux machines. Well that’s fine, I just open up PS and run

Enter-PSSession computer-name

The problem is that I’m usually logged into my PC with an account that does not have permissions to the other PC. If I run PS as a privileged user though, this isn’t a problem. (Yes, I’m sure there’s a way to pass credentials through the Enter-PSSession cmdlet, but that’s not how I solved this.)

One option was to use runas and start PS from the command line

C:WindowsSystem32runas.exe /user:domainusername C:WindowsSystem32WindowsPowerShellv1.0powershell.exe

but then you don’t get the pretty blue PS window and you’re stuck in the command line.

What I ended up having to do was write a PS script to start a PS session under a certain user:

Start-Process powershell.exe -Credential "" -WorkingDirectory "C:"

I called this ps_admin.ps1 and stuck it on my desktop. So now whenever I want to run a PS session as any user, I just click it and get the following popup

From there, I login with any user I want and get the pretty blue PS screen 🙂


Creating a Custom XPath Filter for Windows Server 2008 File Auditing

I need to track down some issues with people overwriting files, so I had our techs turn on File Auditing on one of our servers for whenever a file is changed in a specific directory. Using Windows Event Viewer, I can see all of the changes, but since there are way too many of these, I created a filter called “My Audit” to only show me File System events that were made by a specific user on a specific file. The default filter options do not provide those options so you have to edit the XML Query to:

Spotify Not Working with Windows 8

So I’ve been having a problem with running Spotify under Windows 8 while at work. (At home it runs fine.). I finally have a work around for this!

Basically while listening, your music will just stop playing after 20 seconds or so. When you go to restart Spotify, you’ll get “Unable to initialize the storage of temporary files”. Shoot. So first I tried restarting my computer and reinstalling Spotify. Nope, still stopped playing after a little while.

The problem is that at work, you’re most likely logging in under your work domain (e.g. myworkplacemyusername) and that is causing some problem. All you need to do is:

1) Restart your computer (not log off, restart)

2) Move C:UsersyourusernameAppDataRoamingSpotfiy to C:UsersProgram FilesSpotify (IT might have to do this for you if you aren’t an admin on you PC.)

3) Start listening to music again!

How to Access Windows Files after Computer Freezes at Boot Splash Screen

So my roommate has this Toshiba laptop that runs Windows Vista. He hasn’t applied an update to it in over 6 years. *cry a little*. He was working on some stuff the other day and the computer was started to act really funny, so I suggested that he get his OS up to date. Since he hadn’t done any updates, this was going to take forever. (He needed Service pack one and then two install… :-/)

So after server pack one installed, the computer restarted and got hung on the Toshiba splash screen. I wasn’t able to get to the BIOS or boot order options (F2 / F12). Uhoh. I did the following debugging:

1) First I took out the battery, plugged in the adapter, turned on laptop. Still froze.

2) Took out batter, took out hard drive, plugged in adapter. Success, could reach BIOS and boot.

*Please don’t let the HD be dead*

3) I changed the boot order to read from the DVD first

4) Turned off computer and I put the HD and battery back into the laptop

5) Next I burnt a copy of Fedora 18 Live onto a DVD (I only had Win 8 on my USB)

6) Turned on laptop and loaded Fedora Live.

From here I was able to find the hard drive and copy his files off to another computer. I think I should be able to do a Windows 7/8 upgrade to it and he should also still be able to access the files, but better safe than sorry.