Fix | NVidia Control Panel will not save

Just got Lightroom 6!! Finally they are using the GPU to make things faster. Just one problem, its using my crappy Intel 4600 GPU instead of the NVidia Quadro K1100M in my dual GPU Notebook.

Adobes own advise from their FAQ is to disable the Intel Card. I tried that, all it did is screw up almost everything on the PC. Thanks Adobe for that… So looking around the interwebs I found way too many people having this issue but none having a good solution.

After about 3 hours of messing around with ProcessMon.exe I discovered it was trying to write to c:\ProgramData\NVidia Corporation\Drs folder. Only problem is that folder did not exist.

Simply create the folder, and give “everyone” full control in the security Tab and you should be good to go.

One thing to note, it seemed like it took two saves to start working for me, not sure what that was about but finally I was able to use the “Managed 3D Settings” part of the NVidia Control Panel to set Lightroom.exe to use the NVidia GPU.

Hope it helps you!

-Eric

Powershell | Using Modify AD Groups with Alternate Credentials

Quick one. Had an issue where I needed to remove a user from a AD group in another domain. To my surprise it was harder then I had thought. At first I settled on using set-QADGroupMember (the Quest Powershell CMDLET) as it takes -connectionusername and -connectionpassword. However it was dog slow. I think that was due to being over a WAN link and it was querying all members (which took about 2-3 mins).

I needed something swifter. I went directly to the .NET controls and reduced the time to about 15 second.

$GroupDN = “LDAP://CN=GroupName,OU=Distribution Lists,DC=domain,DC=local”
$Group = New-Object -TypeName System.DirectoryServices.DirectoryEntry -ArgumentList $GroupDN,”username”,”Password”
#To Add
$Group.Properties[“member”].Add(“DN of the User you wish to add”)
#To Remove
$Group.Properties[“member”].Remove(“DN of the User you wish removed”)
$Group.CommitChanges()
$Group.Close()

Enjoy!

-Eric

Powershell | Get Current User Principle Name (UPN)

Quicky,

I had a need to write a Powershell script that would figure out what the current users UPN (User Principle Name) was. Believe it or not I was dumbfounded there wasn’t a good post on it anywhere.  So here is the code:

 

$strFilter = “(&(objectCategory=User)(SAMAccountName=$Env:USERNAME))”
$objDomain = New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.PageSize = 1
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = “Subtree”
$objSearcher.PropertiesToLoad.Add(“userprincipalname”) | Out-Null
$colResults = $objSearcher.FindAll()

$UPN = $colResults[0].Properties.userprincipalname
$UPN

 

Enjoy, if you needed this and found it here please let me a comment, always glad to hear when these things help people out!

Powershell | The Last $Error and Emailing it

OMG some things in Powershell are just too confusing to be useful. What if you need to see the last error message again. What if you want to write it into your script to email you when the error happens?

Well first, its all in $Error

However, $Error is an array.  To access it really requires notation like this:

$Error[0]

The [0] says give me back the last error. Where [1] would say to give me back the second to last error message.

The Problem….

Ok now here is where it gets “funky”. If you just type $Error[0] you get the entire error message like so: (note I am using an error message from some Lync work I have been doing, the names have been changed to protect well me lol)

Set-CsUser : Management object not found for identity “Jerry.Springer@Contoso.com”.
At C:\Scripts\EnableLyncUsers.ps1:138 char:15
+                 Set-CsUser <<<<  -Identity $user.UserPrincipalName -SipAddress $user.UserPrincipalName
    + CategoryInfo          : NotSpecified: (:) [Set-CsUser], ManagementException
    + FullyQualifiedErrorId : Microsoft.Rtc.Management.AD.ManagementException,Microsoft.Rtc.Management.AD.Cmdlets.S
   etOcsUserCmdlet

BUT…. if you type write-host $Error[0] you get this:

Management object not found for identity “Jerry.Springer@Contoso.com”.

So what gives right??? Why when you use Write-Host OR even better when you try to email $Error[0] do we get the crappy short error message? Well I don’t have the answer BUT I do have a great work around.

The Solution….

[string]$ErrorString = $Error[0].Exception
[string]$ErrorString = $ErrorString + ” `n `n ”
[string]$ErrorString = $ErrorString + $Error[0].InvocationInfo.PositionMessage

(that’s 3 lines BTW)

As far as I can tell the only thing one needs are the short error message and the line, script, and command. To do this use the code above and then simply use Write-Host or email that new $ErrorString variable. If you need other data follow the info below from how I figured this out.

Emailing the Error? Simply use this code (replace stuff inside of < > then remove the < >):

    [string]$ErrorString = $Error[0].Exception
    [string]$ErrorString = $ErrorString + ” `n `n ”
    [string]$ErrorString = $ErrorString + $Error[0].InvocationInfo.PositionMessage

    $SmtpClient = new-object system.net.mail.smtpClient
    $MailMessage = New-Object system.net.mail.mailmessage
    $SmtpClient.Host = “<SMTP IP OR NAME>”
    $mailmessage.from = <from@domain.com>
    $mailmessage.To.add(“email1@domain.com,email2@domain.com”)
    $mailmessage.Subject = “<Subject of Email>”
    $MailMessage.IsBodyHtml = $false
    $mailmessage.Body = $ErrorString
 
    $smtpclient.Send($mailmessage)

How did I figure this out?

First I indexed $Error to get me the first result [0]

Next I used the power of Get-Member

$Error[0] | Get-Member

This dumped out all the properties

TypeName: System.Management.Automation.ErrorRecord

Name                  MemberType     Definition                                                                    
—-                  ———-     ———-                                                                    
Equals                Method         bool Equals(System.Object obj)                                                
GetHashCode           Method         int GetHashCode()                                                             
GetObjectData         Method         System.Void GetObjectData(System.Runtime.Serialization.SerializationInfo inf…
GetType               Method         type GetType()                                                                
ToString              Method         string ToString()                                                             
CategoryInfo          Property       System.Management.Automation.ErrorCategoryInfo CategoryInfo {get;}            
ErrorDetails          Property       System.Management.Automation.ErrorDetails ErrorDetails {get;set;}             
Exception             Property       System.Exception Exception {get;}                                             
FullyQualifiedErrorId Property       System.String FullyQualifiedErrorId {get;}                                    
InvocationInfo        Property       System.Management.Automation.InvocationInfo InvocationInfo {get;}             
PipelineIterationInfo Property       System.Collections.ObjectModel.ReadOnlyCollection`1[[System.Int32, mscorlib,…
TargetObject          Property       System.Object TargetObject {get;}                                             
PSMessageDetails      ScriptProperty System.Object PSMessageDetails {get=& { Set-StrictMode -Version 1; $this.Exc…

All of the properties normally can be accessed like this:

$Error[0].Exception

But if you try to write-host $Error[0].InvocationInfo you get:

System.Management.Automation.InvocationInfo

Well that’s not very useful… the reason for this is there are deeper items in the $Error[0].InvocationInfo tree. So if we go ahead and whip out get-member again on $Error[0].InvocationInfo lets see what we get:

TypeName: System.Management.Automation.InvocationInfo

Name             MemberType Definition                                                                             
—-             ———- ———-                                                                             
Equals           Method     bool Equals(System.Object obj)                                                         
GetHashCode      Method     int GetHashCode()                                                                      
GetType          Method     type GetType()                                                                         
ToString         Method     string ToString()                                                                      
BoundParameters  Property   System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=2.0.0.0, Cu…
CommandOrigin    Property   System.Management.Automation.CommandOrigin CommandOrigin {get;}                        
ExpectingInput   Property   System.Boolean ExpectingInput {get;}                                                   
HistoryId        Property   System.Int64 HistoryId {get;}                                                          
InvocationName   Property   System.String InvocationName {get;}                                                    
Line             Property   System.String Line {get;}                                                              
MyCommand        Property   System.Management.Automation.CommandInfo MyCommand {get;}                              
OffsetInLine     Property   System.Int32 OffsetInLine {get;}                                                       
PipelineLength   Property   System.Int32 PipelineLength {get;}                                                     
PipelinePosition Property   System.Int32 PipelinePosition {get;}                                                   
PositionMessage  Property   System.String PositionMessage {get;}                                                   
ScriptLineNumber Property   System.Int32 ScriptLineNumber {get;}                                                   
ScriptName       Property   System.String ScriptName {get;}                                                        
UnboundArguments Property   System.Collections.Generic.List`1[[System.Object, mscorlib, Version=2.0.0.0, Culture=…

Ah… there’s more stuff. Lastly I just needed to figure out what items inside of $Error[0].InvocationInfo I needed. Turns out just one thing. So to write-host it all I needed to do is call:

Write-Host $Error[0].InvocationInfo.PositionMessage

Hope that opens your mind to how more complex objects work in Powershell.

Hey!

Did I help? Make Sense? Something Wrong? Put it in the comments. Love to hear when my write-ups help folks out.

Enjoy

-Eric

Bug | Android | Error 111 (net::ERR_TUNNEL_CONNECTION_FAILED)

Quick one… After spending far too much time I figured it out an issue where I was getting the following error in Chrome on Android when trying to access a SSL website I hosted at my home on port 2000..

“Error 111 (net::ERR_TUNNEL_CONNECTION_FAILED)”

Some extra details… this was on my Nexus 4 on AT&T running first 4.2.1 then 4.2.2.

The real issue, Android for some unknown reason will not allow you to use unstandard ports for SSL (i.e. only port 443 works when using https)

I confirmed this by trying a SSL website on port 2000 using my wifes iphone on AT&T. Sure enough it worked fine. So its not AT&T. Also worth pointing out it works fine on wifi.

Hopefully this is just a bug and will be fixed in the future. The only thing I could do was move my SSL website to the standard port 443.

There was zero info on this on the net so I wanted to get it out there. Hope it sheds some light on it for you. If it did leave a comment so I know.

Office 2013 Installer Failure | “not supported upgrading from a preview version”

Well you are likely here because you are the adventurous type who had Office 2013 Preview installed and then tried to uninstall and install the full release.

Microsoft Office 2013 does not support upgrading from a preview version of Microsoft Office 2013. You must first uninstall these preview versions of Microsoft Office 2013 products and associated technologies:

Microsoft Office 2013 Professional Plus 2013

Some may advise you to go into control panel and remove all Office items from the programs list. However if you are like me then that will not be enough.

If you are still having issues after reviewing the programs list in the control panel then go ahead and delete the following registry key:

HKEY_CLASSES_ROOT\Installer\Products0005102110000000100000000F01FEC

If for some reason that isn’t enough, then delete these as well:

HKEY_CLASSES_ROOT\Installer\Patches\D5360E4B109548941BFB078A144B11D5
HKEY_CLASSES_ROOT\Installer\Patches\D5360E4B109548941BFB078A144B11D5
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\15.0\

if that still doesn’t do it, then search for the phrase “2013” at the root of the registry and start wacking keys that look office 2013 related. However I am pretty sure that first one will take care of you.

Hey if I helped ya, or you can add something to the conversation then please let me know in the comments belooooooow! I take payment in the form of “thanks” in the comments 😉

Windows 8 System Image Tool, Where did it go?

Quick one….

Here is how you can do a full disk image of a Windows 8 system.

If you are like me and just finished setting up your shinny new Windows 8 system, you installed all of your non-metro apps, you activated all of your professional software and now thought, “damn good time to take a image” then had a hard time figuring out where it went…. you are not alone.

In what looks like a ridiculous and frustrating war between Microsoft and Windows Desktop the backup tool is now called “Windows 7 File Recovery”. They also took out direct links to “create a system image” as well.

Yes you are not losing your mind, its not Windows 7, nor is it only file recovery, it’s the only place to get to total system imaging.

Simply Search Metro for “Windows 7 File Recovery” and click the Settings area on the right and you will find it.

image

image

Once in the “Windows 7 File Recovery Tool” go to the top left “Create a system image”

image

Installing Windows 8 RTM to Apple Macbook Air (Boot Camp)

Hey everyone, I wanted to make a few notes to help others get Windows 8 running on their Macbook Air without it locking, freezing, or poor network performance.

First we should stop that whole freezing problem or you will get very upset in the middle of a driver install (been there.)

You need to open a command prompt as administrator. You can do this by clicking start, then typing “cmd” right clicking on the cmd icon and selecting “Run as Administrator’”

Once open run this command:

bcdedit /set disabledynamictick yes

For those who want to know what this does please check out this great post: http://www.withinwindows.com/2012/06/28/workaround-for-windows-8-freezing-issues/

Once installed you will need reboot then install the boot camp drivers. This is done by making the install disk in Apple OS (Mountain Kitty). THERE IS NO DOWNLOAD LINK FOR THIS! DARN YOU APPLE!!! WHAT A PAIN! /RANT OFF

Once you have the Boot Camp disk, copy the contents to a folder on your desktop. Right click on the setup.exe, go to the compatibility tab, then click “Change settings for all users” button on the bottom.

On the next screen change the  “run this program in compatibility mode for:” to Windows 7. Additionally check off the bottom box for “run this program as an administrator”.

Then click OK, then OK again, then run the setup.exe

Once installed go ahead and reboot. This should get you part of the way.

Don’t delete that BootCamp Install folder just yet, deep in there we need the following folder. Just be aware, we will use it soon.

\Drivers\NVidia\NVidiaChipset64

Now lets click the start button, type “device manager” and click the settings “thing” on the top right to discover the “device manager” icon from the remains of the control panel.

Once device manager is open we have a few things to do. First lets take care of those two peskey un-drivered devices “coprocessor” and “SM Bus”.

Right click on one at a time and update the driver. Direct Windows to that folder on the desktop for \Drivers\NVidia\NVidiaChipset64 (or 32 if you are running x86). This folder should be able to updated both missing drivers.

NEXT lets go ahead and change the WiFi driver back to the native Windows 8 driver (Bootcamp had replaced it with a lesser driver that has some issues only in windows 8.)

Simply find the Wireless Network Adapter, its something like “Boardcom 802.11n” right click then “update driver software”, then Search Automaticly for updated drivers.

Thank should do it. Go ahead and reboot one last time for good measure.

Hopefully that saves some of you some time. IF I have helped you all I ask in return is leave a comment and say so. I get a great kick out of it.

Cheers!

-Eric

SCCM 2012 | Native Windows Update Client Not Working

Hey there, are you deploying the Microsoft System Center 2012 Client to your desktops and then like magic the native Windows Client stops working?

Perhaps you even checked the c:\windows\windowsupdate.log file and found this nugget:

2012-07-12    13:57:53:803     392    1220    Misc    WARNING: Digital Signatures on file C:\Windows\SoftwareDistribution\SelfUpdate\wuident.cab are not trusted: Error 0x800b0001

Well then you had the same problem I did. The way I got it to work for me was by installing this hotfix from MS.

http://support.microsoft.com/kb/2720211

In a nutshell you installed .NET 4.0 and WSUS 3.0 With SP2 (as you were required to) and BAMM! Fail.

Hope it helps, if it does leave a comment, love to know when people are helped.

SCVMM 2012 | Force Remove vCenter Server

If you are reading this you likely took the plunge into Microsoft Virtual Machine Manager 2012, you added in your VMWARE vCenter, migrated some VM’s and then tried to jettison the old vCenter  that is no longer around.

If you did you likely got this error message:

VMM cannot complete the VMware operation on the <server> server because of the error: “Unable to connect to the remote server

image

You may have went for extra credit and run this powershell command without luck as well:

Get-VirtualizationManager -ComputerName <server> | Remove-VirtualizationManager

See unlike Remote-VMHost that has the –force switch you don’t have a –force switch with Remove-VirtualizationManager.

What is an admin to do??

Well if you are extremely irresponsible and want to blindly follow a guy with a blog who happened to find a way that at least looks like it worked then good Sir or Madam you are in the right place!!!

SQL Studio with Admin Rights

First you will need to run SQL Studio Manager with rights to the DB. If you have this then move on to the next section.

If like me you didn’t end up having permission to the default instance then run this nifty sysInternals tool PSEXEC:

PSEXEC –i –s cmd (make sure to run with admin rights)

If that works and you now have a cmd prompt go ahead and type whoami just for fun. you will see you are NT Authority\Local System!

Now go ahead and run the SQL Studio Manager from this command prompt. Given each version of SQL has this in a different location the easiest way would be to look at the properties of the start menu shortcut to find the full path to the executable.

The Query

Ah now once in SQL Studio with rights to the DB simple run this query to force remove the vCenter from your VMM instance.

HEY!!! SERIOUSLY I HAVE NO IDEA IF THIS IS SAFE!! USE AT YOUR OWN RISK.

DECLARE @computername varchar(255)
SET @computername = ‘<servername>’
DELETE FROM [tbl_ADHC_AgentServerRelation] WHERE AgentServerID = (select top 1 AgentServerID from tbl_ADHC_AgentServer where Computername = @computername)
DELETE FROM [tbl_ADHC_AgentServer] WHERE AgentServerID = (select top 1 AgentServerID from tbl_ADHC_AgentServer where Computername = @computername)
DELETE FROM [tbl_ADHC_Host] WHERE [HostID] = (select top 1 HostID from tbl_ADHC_Host where ComputerName = @computername)

Now, if I you know a better way please leave a comment.

If this helped you, please leave a comment. Love knowing my time wasn’t wasted.

If you are Microsoft and you feel I am leading people off a cliff, PLEASE PLEASE leave me a comment.

In any event, hope it helps and enjoy!

-Eric