Saved for later reference

online repository of stuff I had to google for hours to figure out – and random snippets of code

“Microsoft Dynamics CRM for Outlook with Offline Access has already been configured for a user on this computer. Only one use can be configured per computer for Microsoft CRM for Outlook with Offline Access.”

Tags: , , ,

If you try to swap users on a laptop, with Dynamics CRM installed in Offline Access mode, it will give the error above; searching gave me this page from the Chinese Dynamics CRM team, so I’m just going to repeat it here:

1
2
3
4
  C:\>osql –E –S localhost\CRM
      1> drop database mscrm_msde
      2> go
      1> quit

Basically, you connect to the SQL Server on the local computer, and delete the Offline Access database, allowing you to reconfigure as normal. Note that this won’t let you reconfigure the user as “online only” – the new configuration will automatically be Offline Access.

Secondly, this works even if the user is not Local Administrator on the computer.

Share

Script to add a network printer automatically in Windows

Tags: , , , , ,

I recently had to replace a defective printer with a similar model, but different enough to need a new driver. This meant it would have a new name on the print server, and I had to figure out a way to replace the installed printer on each computer quickly. After some searching, I ended up with the following script:

1
2
3
4
5
6
@echo off
set OLDPRINTER="\\printserver\Xerox Phaser 8560N"
set NEWPRINTER="\\printserver\Xerox Phaser 8560DN PS"
rundll32 printui.dll,PrintUIEntry /q /dn /n%OLDPRINTER%
rundll32 printui.dll,PrintUIEntry /in /n%NEWPRINTER% /q
rundll32 printui.dll,PrintUIEntry /y /n%NEWPRINTER%

The first rundll32 line quietly (/q) deletes (/dn) the printer named (/n) %OLDPRINTER%, while the second line installs (/in) the new printer %NEWPRINTER%, and the final line sets the new printer as default (/y)

Share

Active Directory user GUID

Tags: , , , , , ,

I found this page which contains an old oneliner to get a user GUID in PowerShell – but sadly it doesn’t work anymore.

After some tricking around, I found the following to work:

1
(new-object Guid(,(([directoryservices.directorysearcher] "(samaccountname=theuser)").findall())[0].properties["objectguid"][0])).ToString()
Share

© 2009 Saved for later reference. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.