Wednesday, March 30, 2011

Generate Computer names in MDT 2010/SCCM - Update

I've created an advanced stored procedure. The new stored procedure build on the last one that has the OU assignment , but the new one gives you the possibility to have different prefix on you computers based on location. It is also possible to have custom sequence for each location, so all your computers on location A could be named PC-Location(A)-Type*-Sequence(00001), PC-Location(A)-Type*-Sequence(00002), and PC-Location(B)-Type*-Sequence(00001),PC-Location(B)-Type*-Sequence(00002).

If you want to have computer type (Desktop,laptop,VM) in your computer name. You can easily add the following in the stored procedure:

In the IF @isvm/isdesktop/islaptop sequences add the following:
Set @type=’L’ or ‘D’ or ‘V’
(If you want the computer names for laptops to contain an L to identify that its a laptop, D for desktop and V for Virtual.

You also have to add the following in the Set @newname
set @newname = @prefix '+' @type '+' etc.....

These changes have to be made on all three IF statements for each computer type, a total of 6 entries. 2 per IF statement.

The files can be downloaded here:

1 comment:

Unknown said...

Hey ,

I have written how to generate computer names dynamically with simplicity of webservice