Showing posts with label PowerShell. Show all posts
Showing posts with label PowerShell. Show all posts

Creating an eventlog source from the command line

Posted on Wednesday, October 30, 2013 by Nicki

We've all at some stage had to create an eventlog source for an ASP.Net application, as by default it does not have the privileges to create it on the fly. I found this nifty PowerShell command that does this without having to write a console app.

New-EventLog -LogName Application -Source MyApp
Source: http://stackoverflow.com/questions/446691/how-to-create-windows-eventlog-source-from-command-line

Authorization Manager check failed - FIX - for real this time!

Posted on Tuesday, January 17, 2012 by Nicki

We finally managed to find a fix for the above PowerShell error that pops up from time to time: restart the Windows Management Instrumentation (WMI) service!

AuthorizationManager check failed - SOLUTION!

Posted on Thursday, February 17, 2011 by Nicki

I found a solution to the above problem first mentioned here today by pure chance. Since PowerShell is part of SQL Server 2008 (I think!), I decided to restart SQL Server 2008 on my machine when the error surfaced yet again today, as I was not in the mood for a reboot (too many open files & sessions).


Guess what, the error disappeared! So there must be some tight integration between SQL Server and PowerShell for this to be the solution. 

Please see this post for a repeatable solution.

Powershell takes a dive

Posted on Wednesday, June 30, 2010 by Nicki

Yesterday I was happily running some PowerShell scripts as part of our build process, when suddenly PowerShell took a dive for the worse.

All attempts to run PowerShell scripts returned the following error:


AuthorizationManager check failed


After a lot of fiddling and checking the Group Policy settings for PowerShell, I decided to reboot. Guess what, problem solved!

Let that be a reminder of MS std support action #1: reboot

My first foray into PowerShell

Posted on Friday, July 17, 2009 by Nicki

I needed to change the date/timestamp on a file, and found that the touch utility does not exist. I also could not find the XP resource kit download, which apparently contains it. Then I remembered that PowerShell was installed when I recently installed SQL Server Express 2008.


Here is how to change the timestamp of test.txt in the current directory to 31/08/2012 with PowerShell:
$(get-item test.txt).lastwritetime=$(get-date "08/31/2012")


You can find more info here.