Wednesday, November 30, 2011

A Great Exchange Enviroment Report Script

While looking for a PS script today to report what there installed verison including any Update Rollups I found this PS Script that gives and exchange admin a good look in to what is going on with there exchange enviroment. Check it out for your self http://www.stevieg.org/2011/06/exchange-environment-report/  Thanks Steve Goodman for the great script.

Friday, November 18, 2011

Another GroupWise to Exchange Migration

Well, I am at it again, migrating a recent acquisition from GroupWise to Exchange 2010. I hope to later in December post the scripts that I used to take our Quest exports to Mail-Enable all the users and configure the mailbox settings.



Well back to the Migration

Thursday, September 8, 2011

MFCMAPI

Today I learned the power of MFCMAPI!

While troubleshooting an issue for a user I used MFCMAPI to view the MailStore for the user allowing me to view all folders in her mailbox including the hidden ones. Once I was able to locate the "missing" folder I was able to copy/move the folder back to the root of the mailbox.

Download MFCMAPI here: http://mfcmapi.codeplex.com/

Rebuilding theWMI Repository Rebuild

Here is  a nice little batch file that I found to rebuild your WMI repository.


If you see the following error code in your C:\windows\system32\wbem\logs\wbemcore.log you are seeing
0x80041002 errors then it would be a good idea to have that repository rebuilt. This also resolves issues with the the error code -2147217406 Not able to connect to WMI namespace "root\CIMV2"
Once the batch file below is run you will need to restart the device. Please note that if you have SCCM installed you will need to reinstall the client as all the WMI Namespaces are removed.
net stop winmgmt /y
c: 
cd %systemroot%\system32\wbem 
rd /S /Q repository 

regsvr32 /s %systemroot%\system32\scecli.dll 
regsvr32 /s %systemroot%\system32\userenv.dll 

mofcomp cimwin32.mof 
mofcomp cimwin32.mfl 
mofcomp rsop.mof 
mofcomp rsop.mfl 
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s 
for /f %%s in ('dir /b *.mof') do mofcomp %%s 
for /f %%s in ('dir /b *.mfl') do mofcomp %%s 

Thanks http://msmvps.com/blogs/lduncan/pages/20217.aspx for putting this together .

Monday, August 1, 2011

Let me start by saying this is the weirdest issue I have ran into that I have not been able to resolve without taking drastic measures.

Synopsis of the issue:

A single user calls stating that the mailboxes that she has full access to are no longer showing up and free/busy searches are no longer working and in testing OOF is not working either. As a part of troubleshooting the issue I delete and attempt to recreate the users mail profile (No Dice acts like auto discover fails or the mailbox cannot be found) , run a test of autodiscover from the Outlook client it failes with the error code of 0x800C8203. Additionally I test Autodiscover via the test-outlookwebservices cmdlet it test fine but when the cmdlet is run adding the -Identity option with the users email address I get the following error Autodiscover returned the error: 603:The Active Directory user wasn't found. After a quick google search I was able to find a somewhat simple yet painful fix of deleting the AD account and reconnecting the mailbox, at this point I was willing to try anything. So I disconnected the mailbox from the user, deleted the AD account then recreate the AD and reconnect the mailbox and like magic everything was working as it should.

Should any one reading this post know of a better solution the killing the AD account please feel free to leave a comment below with the fix.

-Till next time

Monday, May 23, 2011

OCS 2007R2 Web Access loads a Blank Page

So today I ran in to an interesting issue with our OCS 2007 R2 web access server. The issue was when accessing the site to logon all you would receive is a blank page. I viewed the source and it was loading the page but nothing would display, it would also show the proper certificate for OCS. I tried everything that I could think of including uninstalling and reloading the web access components several times.  After a day of troubleshooting I discovered a blog post about another issue and it talked about the local security policy and that the Impersonate a client after authentication setting was missing IIS_IUSRS account. I checked our settings and discovered that we to were missing the IIS_IUSRS from that setting. after re adding the account back and a restart lo and behold the site loaded as it should.

Tuesday, April 12, 2011

SCCM OSD Prompt For Computer Name

Looking for a way to allow you to prompt for a computer name during the baremetel imaging process? Well thanks to Nick Moseley over at http://t3chn1ck.wordpress.com/ we have a way to do that. Here is the code for the VBS with my changes .

 How To Add To Your Task Sequence

1. Create a New Package, and assign a DP for your script(s) you do not need to create a program for your script.
2. In your task sequence after the Partition Disk task add a task to run a Command Line.
3. In the command line section enter the name of the vbs.
4. Check the package and select the package you created in step 1.



















Code:

'==========================================================================
' NAME: PromptForSystemName.vbs
'
' AUTHOR: Nick Moseley
' DATE  : 6/1/2009
'
' COMMENT: This script will detect if the current assigned value for the computer name
' begins with MININT, indicating that this image is bare metal image.  It then prompts
' the end-user to enter a new computer name.
'
' VERSION : 1.1
' 1.0 (12/08/2008)- Intial script to check if the computer name begins with
'  "minint", which indicates the system was booted with CD or PXE.
' 1.1 (06/01/2009)- Added check if the computer name equals "minwinpc",
'  which indicates the system was booted with USB key
' 1.2 (04/07/2011)- Added check for vaild length of ComputerName -Matt Karel
'==========================================================================


Dim sNewComputerName, oTaskSequence, sTSMachineName, bPromptName
Set oTaskSequence = CreateObject ("Microsoft.SMS.TSEnvironment")

' Get the name the computer is set to receive and truncate to first 6 letters
sTSMachineName = lcase(oTaskSequence("_SMSTSMachineName"))

If left(sTSMachineName,6) = "minint" Then
 bPromptName = True
ElseIf sTSMachineName = "minwinpc" Then
 bPromptName = True
Else
 bPromptName = False
End If

' Note: The wscript.echo commands are logged in SMSTS.log for troubleshooting.  They are not displayed to the end user.
If bPromptName = True Then

    Do Until ValidName=1
        wscript.echo "Detected that the computer name is scheduled to receive a random value.  Prompting user to input a standard name."
        sNewComputerName = InputBox ("Please enter a standard computer name to continue.", "Computer Name",sTSMachineName, 30,30)
        ValidName=CheckComputerName(sNewComputerName)
    Loop

    oTaskSequence("OSDComputerName") = UCase(sNewComputerName)
    wscript.echo "Set Task Sequence variable OSDComputerName to: " & sNewComputerName
Else
     wscript.echo "Computer set to receive a standard name, continuing as is."
End If

Function CheckComputerName (CompName)
    If Len(CompName)=0 Then
        result=Msgbox("You must enter a computer name to continue.",vbExclamation+vbSystemModal,"Invaild Input")
        CheckComputerName=0
    ElseIf Len(CompName)<=15 Then
        CheckComputerName=1
    Else
        result=Msgbox(ucase(CompName) & " Is to long of a computer name. Computer names are limited to 15 characters or less.",vbExclamation+vbSystemModal,"Invaild Input")
        CheckComputerName=0
    End if
End Function

Tuesday, April 5, 2011

New Hardware Wizard Running after OSD Deployment

So a colleague and I have been working on a new XP SP3 thin image and have been fighting an issue of the New Hardware Wizard displaying after first login. after much searching and many edits to the sysprep.ini I stumbled upon a post by Ben Tucker* and thought what the heck we will give this a shot. well low and behold it worked. So if You are having issues with the New Hardware Wizard appearing after you image a workstation with SCCM 2007 or MDT add rundll32.exe Syssetup.dll,UpdatePnpDeviceDrivers to a command line task to your task sequence under Setup Operating System  Note:this command is case sensitive.
Enjoy!

-Till Next Time
Matt Karel


Source:
(http://blogcastrepository.com/blogs/brian_tucker/archive/2007/12/11/sccm-2007-osd-drivers-show-as-new-hardware-found-when-you-login.aspx)

Monday, April 4, 2011

Mounting My TV

Just a small little project to mount my bedroom TV and install power and run 2 HDMI cables in the wall. Enjoy.









Wednesday, March 30, 2011

ConfigMgr 2007 R2 SP2 OSD Imaging issue

So for the past several months my coworker and I have been wanting to update our Imaging process from an unatteded install of XP to a true Slim Image using SCCM 2007 OSD.

During the process of doing this we keep running in to an issue of applications not installing when we would bring down our test image that was captured using a CD instead of a Build and Capture task sequence. After much googling we could not find anything that would fix our issue, so we place a call to the boys in blue (Microsoft) after looking though our smsts.log Microsoft noticed a small oddity during the process of installing the SCCM Client.


Basicly what the issue was when OSD would go to install the SCCMClient  it would error out with a 0x80004005 error code. It would error out during this step because CCMSetup was running with a switch of /config:Mobileclient.tcf. the odd thing though was our configmgr package did not have this configured there and we still do not know where this is coming from. So for now we have rename Mobileclient.tcf to .old and wallah the issue is now resolved.

Successfully registered TS Progress UI.    OSDSetupHook    3/30/2011 4:01:38 PM    896 (0x0380)
Executing C:\_SMSTaskSequence\OSD\BHG00077\ccmsetup.exe /useronly /config:MobileClient.TCF /status:1592    OSDSetupHook    3/30/2011 4:01:38 PM    896 (0x0380)
Command line for extension .exe is "%1" %*    OSDSetupHook    3/30/2011 4:01:38 PM    896 (0x0380)
Set command line: "C:\_SMSTaskSequence\OSD\BHG00077\ccmsetup.exe" /useronly /config:MobileClient.TCF /status:1592    OSDSetupHook    3/30/2011 4:01:38 PM    896 (0x0380)
Executing command line: "C:\_SMSTaskSequence\OSD\BHG00077\ccmsetup.exe" /useronly /config:MobileClient.TCF /status:1592    OSDSetupHook    3/30/2011 4:01:38 PM    896 (0x0380)
Process completed with exit code 1    OSDSetupHook    3/30/2011 4:01:39 PM    896 (0x0380)
FALSE, HRESULT=80004005 (e:\nts_sms_fre\sms\client\osdeployment\osdgina\installclient.cpp,1078)    OSDSetupHook    3/30/2011 4:01:39 PM    896 (0x0380)
Client installation failed, code 1    OSDSetupHook    3/30/2011 4:01:39 PM    896 (0x0380)

Tuesday, March 22, 2011

Undocumented Citrix PNAgent Command Line Switches

The list below is a list of undocumented switches for Pnagent.exe Version 12.1.030 but may work on older versions of pnagent. I have used a few of them with success when needing to script an uninstall of a client or needing to manipulate the client in a way without causing a outage. For example I needed to basically have the pnagent reconnect to the server, but need to do it via a script. I ran pnagent.exe /configurl /pram:<our url to WI> and that caused pnagent to reconnect simulating a user terminating pnagent with out terminating and with out losing connection to any open applications.

Use the below list with caution and always test to avoid any unwanted side-affects.


/Terminate Closes out PNAgent and any open sessions
/terminatewait  Closes out PNAgent and any open sessions
/Configurl  /param:URL
/displaychangeserver
/displayoptions
/logoff
/refresh
/disconnect
/reconnect
/reconnectwithparam
/qlaunch

Till Next Time!

Monday, March 21, 2011

Replacing The HD on a 24inch iMac




















Using 2 Suction Cups in opposing corners, I remove the glass panel. This glass panel is held on using a series of magnets around the bezel. Once the glass is removed it will expose the necessary T8 Screws that need to be removed.

Once the bezel is removed you will have access to remove the 8 or so T8 screws holding down the LCD panel. Once remove the screws are removed you can lift display. Note that you will want a second set of helping hands as the display cables are still attached to hold the display as the drive is replaced.
With your second set of hands holding the display remove the 2 T8 screws holding the 3.5 inch drive from its mount. Now slide the black drive mount towards the supper drive. Next carefully remove the thermistor that is located on the drive case and disconnect the SATA and Power cables from the drive. Now Pull the drive towards you removing it from the case. 



Friday, March 18, 2011

How to Remove a Contact from Outlook Web App's AutoFill List


  1. Login to the account.
  2. Compose a new message.
  3. In the To field start to type the name of the individual.

  4.  Arrow down till you have highlighted the contact you wish to delete.
  5. Press the Delete Key on your keyboard and the contact will be removed from the AutoFill list before your eyes.

Thursday, March 17, 2011

GroupWise To Exchange 2010 Part 1

Over the course of 2010 I was responsible for Migrating 4,000+ GroupWise accounts to Exchange 2010SP1. I would like to share a little over view of the project and some of the scripts I wrote.

While most of the setup of our Exchange environment was setup by a local consulting company I was responsible for the data migration, Blackberry migration, and the roll-out of office 2010 from office 2000 & 2003. while planning and prep work took about a year the actual roll-out /  cut over was to be over the course of a weekend yes 48+hrs to move 90 days of email calendar data. A combination of Quest Software's GroupWise Migrator for Exchange and a set of PowerShell Scripts allowed for such a successful cut-over aka the ripping of the band-aid approach.

Our environment  already had  Active Directory deployed and was the primary method of authentication, the only thing that NDS was used for GroupWise authentication. in order to do most of the mass operations I wrote 5 different Powershell scripts to handle this that would work off the CSV's that the Quest tool would output and use for the migration. The first script would Mail Enable an account on a random database, enable their archive on a random database if they had one, and set the mailbox limitations based off of a classification that was assigned to the user. Error logging was also incorporated into the script to allow us to fix any AD account.

Tomorrow I will will share my scripts used to set the primary email address and to set the visablity of the account to the address book.


Till next time.


#Created By Matt Karel Copyrighted Sept 2010
Add-PSSnapin Microsoft.Exchange.Management.Powershell.E2010 -ErrorAction SilentlyContinue
#Create new object to generate random numbers
$Rand=new-object System.Random

#Build 1d array of DB
$Databases=("DB1_A"),("DB1_B"),("DB2_A"),("DB2_B"),("DB3_A"),("DB3_B"),("DB4_A"),("DB4_B"),("DB5_A"),("DB5_B"),("DB6_A"),("DB6_B")

$ArchiveDatabases=("MBX1_Archive1"),("MBX1_Archive2"),("MBX2_Archive1"),("MBX2_Archive2"),("MBX3_Archive1"),("MBX3_Archive2")

$Errorfile = New-Item -type file "Enable-Mailbox ErrorLog.txt" -Force
$Error.Clear() #Clears the Error Variable that stores Error Information

# Import the CSV file   modify the path to your file here
#$csv = Import-CSV "C:\PS-Scripts\CSVs\BHGPO4.csv"
$CSVPath= read-host "Enter the Path to the Quest CSV here"
$csv = Import-CSV $CSVPath
# Your domain name
$domain = 'domain.local"

# Mailbox Database to create mailboxes in (format is server\StorageGroup\Database Name)
#$database = 'SERVER\StorageGroup\Database'

#Function Section
Function EnableMailbox {
    Trap {
        Add-Content -Path "$Errorfile" -Value "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        add-content -Path "$Errorfile" -Value "Error Enabling Mailbox $UserID "
        add-content -Path "$Errorfile" -Value  $Error[0].ToString()
        add-content -Path "$Errorfile" -Value ""
        Write-Host "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        Write-Host $Error[0].ToString()
        Continue
        }
     Enable-Mailbox -Identity "$domain\$UserID" -Database "$DB" -PrimarySmtpAddress "$Email" -Alias "$Alias" -ErrorAction Stop
}
Function EnableArchive {
    Trap {
        Add-Content -Path "$Errorfile" -Value "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        add-content -Path "$Errorfile" -Value "Error Enabling Archive $UserID "
        add-content -Path "$Errorfile" -Value $Error[0].ToString()
        add-content -Path "$Errorfile" -Value ""
        Write-Host "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        Write-Host $Error[0].ToString()
        Continue
        }
     Enable-Mailbox -Identity "$domain\$UserID" -Archive -ArchiveDatabase "$ArchiveDB" -ErrorAction Stop
}
Function ModifyCASMailbox {
    Trap {
        Add-Content -Path "$Errorfile" -Value "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        add-content -Path "$Errorfile" -Value "Error Set-CasMailbox $UserID "
        add-content -Path "$Errorfile" -Value $Error[0].ToString()
        add-content -Path "$Errorfile" -Value ""
        Write-Host "$PO   -----  $DisplayName   -----  $Email   -----  $UserID"
        Write-Host $Error[0].ToString()
        Continue
        }
     Set-CASMailbox -Identity "$domain\$UserID" -ActiveSyncEnabled:$ActiveSync -ErrorAction Stop
}
Function TestForMBX {
   
     $MBXExists=Get-Mailbox -Identity "$domain\$UserID" -ErrorAction SilentlyContinue
     If($MBXExists){
        Return $true
     }Else{
        Return $false
     }
}

# Loop through the CSV and create a new user & mailbox for each line found
foreach ($Record in $csv){
    $DB=$Databases[$Rand.Next(1,12)] #Get a random database
    $Email=$Record.TargetAddress
    $UserID=$Record.Userid
    $Class=$Record.Class
    $PO=$Record.PostOffice
    $DisplayName=$Record.DisplayName
   
    $Temp=(Get-Culture).TextInfo.ToTitleCase((($UserID).ToLower())) #Drop the user id to Title Case
    $Alias=$Temp.substring(0,$Temp.length -1)+$Temp.substring($Temp.length -1,1).ToUpper() #Use the Temp Var to set Alias var with the first and last char to caps.
   
    $Temp=(Get-Culture).TextInfo.ToTitleCase((($Email).ToLower())) #Drop the Email id to Title Case
    $EmailDomain=$Temp.substring($Temp.IndexOf("@")).ToLower()
    $Email=$Temp.substring(0,$Temp.length -15)+$Temp.substring($Temp.length -15,1).ToUpper()+$EmailDomain #Use the Temp Var to set Alias var with the first and last char to caps.

   
               Switch ($Class){
                1 {
                    $MB_Size_Warn="1.8GB"
                    $MB_Size_ProhibitSend="2GB"
                    $Archive=$TRUE
                    $ActiveSync=$FALSE
                    $RetentionPolicy=$null
                    $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                    $ArchiveQuota="50GB" #Exchange Default
                    $ArchiveWarnQuota="45GB" #Exchange Default
                   }
                 1a {
                    $MB_Size_Warn="1.8GB"
                    $MB_Size_ProhibitSend="2GB"
                    $Archive=$TRUE
                    $ActiveSync=$FALSE
                    $RetentionPolicy="Default Archive-Enabled Retention Policy"
                    $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                    $ArchiveQuota="50GB" #Exchange Default
                    $ArchiveWarnQuota="45GB" #Exchange Default
                   }
                 2 {
                     $MB_Size_Warn="921MB"
                     $MB_Size_ProhibitSend="1GB"
                     $Archive=$TRUE
                     $ActiveSync=$FALSE
                     $RetentionPolicy="Default Archive-Enabled Retention Policy"
                     $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                     $ArchiveQuota="1GB"
                     $ArchiveWarnQuota="900MB"
                   }
                 3 {
                     $MB_Size_Warn="720MB"
                     $MB_Size_ProhibitSend="800MB"
                     $Archive=$TRUE
                     $ActiveSync=$FALSE
                     $RetentionPolicy="Default Archive-Enabled Retention Policy"
                     $ArchiveDB=$ArchiveDatabases[$Rand.Next(1,6)]
                     $ArchiveQuota="800MB"
                     $ArchiveWarnQuota="720MB"
                   }
                 4 {
                     $MB_Size_Warn="180MB"
                     $MB_Size_ProhibitSend="200MB"
                     $Archive=$FALSE
                     $ActiveSync=$FALSE
                     $RetentionPolicy="Default No Archive Retention Policy"
                   }

            }
                           
                If($Archive -eq $FALSE){
                    If (TestForMBX){
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -RetentionPolicy "$RetentionPolicy"
                        ModifyCASMailbox
                    }
                    Else{
                        EnableMailbox
                        Start-Sleep -m 200
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -RetentionPolicy "$RetentionPolicy"
                        ModifyCASMailbox
                    }
                }
                   
                If($Archive -and $Class -eq "1") {
                    If (TestForMBX){
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy $null -ErrorAction Continue
                        ModifyCASMailbox
                    }
                    Else{                                           
                        EnableMailbox
                        Start-Sleep -m 200
                        EnableArchive
                        Start-Sleep -m 200
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy $null -ErrorAction Continue
                        ModifyCASMailbox
                    }
                }
                elseif($Archive -and $Class -ne "1"){
                    If (TestForMBX){
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy "$RetentionPolicy" -ErrorAction Continue
                        ModifyCASMailbox
                    }
                    Else{
                        EnableMailbox
                        Start-Sleep -m 200
                        EnableArchive
                        Start-Sleep -m 200
                        Set-Mailbox -Identity "$domain\$UserID" -UseDatabaseQuotaDefaults $false -ProhibitSendQuota "$MB_Size_ProhibitSend" -IssueWarningQuota "$MB_Size_Warn" -ArchiveQuota "$ArchiveQuota" -ArchiveWarningQuota "$ArchiveWarnQuota" -RetentionPolicy "$RetentionPolicy" -ErrorAction Continue
                        ModifyCASMailbox
                    }
                }

        }

Wednesday, March 16, 2011

My First Post

Well today marks the start of my first ever BLOG! With this blog I hope to bequeath useful things that I find in my day to day job as a desktop engineer and Exchange administrator.

Till next time