• 17Jul

    From the powershell command line run:

    Start-Process powershell -Verb runAs

    Hit “Yes” and you’re in!

    -Harry Caskey

    Tags: ,

  • 13Sep

    Awhile ago I needed to find the Serial Number of a remote machine so I could pull the drivers, traveling to see that machine became very tedious and took time.  So I did some searching and came accross this command that you can run via-command line with either powershell or by remotely connecting to the machine and running this from command prompt.

    If you open up a command line window you can call on the WMIC command to pull the BIOS serial number of a machine.

    wmic bios get serialnumber

    You can also run this WMIC command to get the computer model number.

    wmic csproduct get name

    For further information here is the Microsoft KB: http://support.microsoft.com/kb/558124

    Tags: , ,

  • 03Aug

    I’ve run into issues where an SCCM client will get repaired and the cache size automatically goes back to 5120MB.  This causes a problem if you have applications that you are advertising that are bigger than 5GB.

    So my solution was to created a PowerShell script that first checks to see what the current cache size is and if it is not what I specified change it and restart the SCCM Client on the host.  If the client is set to the cache size I have specified then simply exit.  I have also set this PS Script to be a scheduled task so it frequently runs the check.  You can do this very easily through Group Policy (if desired).

    If you have any questions about this script, please feel free to contact me.

    # Script developed by Harry Caskey
    # harrycaskey@gmail.com
    # http://www.harrycaskey.com/
    # Please give me feedback on this script if it works for you!

    # First thing is specify the WMI object you want to query.
    $CacheSize = 51200
    $Cache = Get-WmiObject -namespace root\ccm\SoftMgmtAgent -class CacheConfig
    # Then run this IF statement to check to see if the Cache Size does not equal (-ne) to the $CacheSize variable .
    If ($Cache.size -ne $CacheSize) {
    $Cache.size = $CacheSize
    $Cache.InUse = "True"
    # If the cache size does not equal to the $CacheSize variable then apply.
    # Restarts the service after the Put() command. This is optional, not required and not recommended if you are deploying this script with SCCM.
    #Restart-Service ccmexec
    Else {

    Here goes the script if you would like to download it: Set-SCCMCacheSize.zip


    – Harry Caskey

    Tags: , , ,

  • 13Aug

    To do this you must open up the Exchange Management Shell on Exchange 2007.  Then at the prompt you will want to find the GUID for the mailbox you wish to delete.  You can do this by typing the following command:

    Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

    You should then see a prompt like this.

    To remove individual mailboxes use the  following command with your servers info replaced in bold:
    Remove-Mailbox -Database “Database-Name” -StoreMailboxIdentity MailboxGuid -confirm:$false

    After this runs check to see if the GUID is gone by running the “Get-MailboxStatistics” command again.  After this has been run the mailbox has been removed from the system.

    To remove all disconnected mailboxes use the following commands, please note replace “Mailbox Store” with your information.

    This command will query the current disconnected mailboxes.
    $users = Get-MailboxStatistics | where-object { $_.DisconnectDate -ne $null } | Select DisplayName,MailboxGuid

    This command will use the query to remove the mailboxes.
    $users | ForEach { Remove-Mailbox -Database “Mailbox Store” -StoreMailboxIdentity $_.MailboxGuid -confirm:$false }

    – Harry Caskey

    Tags: , ,

  • 08Apr

    I thought today I would blog about an experience I had with Exchange Server 2007 last June 16th, 2008 we had a power outage early in the morning which resulted in server failures across the board.  This then caused a chain reaction when the backup domain controller went down. The Active Directory systems dropped off the network leaving computers requesting AD authentication dead in the water. Then our Exchange Server went offline causing an unexpected shutdown. As files are writing to the disk this can always cause corruption. In this case it did.

    When the system came back online there happen everything was fine and dandy. Until we noticed that the Public Folders was offline. Now we are running an Exchange Server 2007 when I signed on this machine it would not mount. To fix this problem I had to use a PowerShell command to repair the Public Folders.

    At the PowerShell command prompt I used the following command.

    First run the repair command on the database, you want to repair any damage before and defragmentation because you may make the corruption irreversible.

    repair eseutil /p “[Drive Root]\Program Files\Microsoft\Exchange\[Location of the Database]”

    Second run a defragment command, this will clean out and organize the database so it works more efficiently. I highly recommend doing a defragment after the repair this will ensure integrity and stability after the repair has complete.

    defragment eseutil /d
    “[Drive Root]\Program Files\Microsoft\Exchange\[Location of the Database]”

    Then when you remount the database in the exchange console and it should work. By reconnecting the repaired store this should automatically bring the Public Folder share back online.

    – Harry Caskey