Category Archives: Enteo

Cataloging Exported packages from Frontrange Enteo / DSM 7 with Powershell.

This is just a quick powershell script I threw together to catalog exported packages.

By default when you export packages from Frontrange DSM (formerly Enteo) you end up with a large list of unique id’s with no real idea which package is which.

The below quick and dirty Powershell function will enumerate the xml file in each package folder and create a catalog which you can then export to csv if you wish.

To retrieve the list of packages and names, use the following command:

(where c:export is the location of your export)

get-DSMpackages -DirectoryPath "C:Export"

This will present itself as below:

To export the file to csv, try the following:

(where c:export is the location of your export, and you wish to save the csv file to c:exportcontents.csv)

get-DSMpackages -DirectoryPath "C:Export" | Export-Csv C:Exportcontents.csv -notypeinformation

This should create the csv file and look as follows:

Below is the function:

[sourcecode language=”Powershell”]
function get-DSMpackages{
param(
[Parameter(Mandatory = $true)]
[string]$DirectoryPath)

$result=@()

foreach ($folder in Get-ChildItem $directorypath | where {$_.psiscontainer -eq $true}){

[xml]$XMLBlock = get-content "$($folder.fullname)_ExpInfo.xml"
$name=$xmlblock.dsmexport.ArrayOfMdsObject.MdsObject.Name
if ($name -eq $null){
[xml]$XMLBlock = get-content "$($folder.fullname)_ExpInfo.xml"
$name=$xmlblock.dsmexport.ArrayOfMdsObject.mdsobject[0].name
}
$entry = New-Object PSObject -Property @{
Name=$Name
GUID=$folder.name}
$result+=$entry
}#end for
return ($result | sort name)
}#end function
[/sourcecode]

How do you move a computer automatically from one OU to another using a script?

I was asked the following question recently when finishing our Citrix server deployment method.

We needed a script that would run on a computer as part of a sequence of scripts that would move a server from its current OU to the servers final resting place a terminal servers OU.

The below script achieved what we needed by using the computers %computername% variable to move the computer.

In our case the following apply:

·The computers name is using the variable %computername%

·The domain is domain.net

·The computers OU before the move is computers

·The OU we wish to move to is Terminal Servers

dsmove “CN=%computername%,OU=computers,DC=domain,DC=net” -d domain.net -newparent OU=”Terminal Servers”,DC=domain,DC=net

if you are unaware of the computers current OU before the move and you still wish to script the move, the following forum post will get you in the right direction.

Enteo: The 10 minute rule on batch files.

Heres a tricky problem with Enteo, When executing a batch file enteo only gives a batch file 10 minutes to complete before moving on.

Generally speaking this is no problem as how many batch files do you run take over 10 minutes?

This problem came to light for us when enteo began causing our ESX servers to purple screen of death during the pe stage of the build, which resulted in us moving our virtual servers to a stable ESX while we rebuilt. The problem was that the ESX was so slow with all the added servers that our scripted citrix updates were taking over 10 minutes, the script continued, rebooted the server during the updates and low and behold a very sick citrix server.

The trick to get around this, and i recommend this for any batch file you run in enteo, is to create a looping if statement in the enteo script to check for a registry key. Once you have this key created run your updates then delete the key as the last line in your batch file. This will cause enteo to loop even after the 10 minutes leaving your critical updates to install without fear of being.

heres the idea for the enteo script:

execute %systemdrive%longbatchfile.bat /?
:check
if exist regkey goto sleep
del %systemdrive%longbatchfile
Exitproc
:sleep
sleep 60
goto check

And in the batchfile create the reg key, do your work then delete it:

reg add hklmsoftwareenteo /v checkkey
update1
update2
update3
update4
update5
reg delete hklmsoftwareenteo /v checkkey

what will happen is simple, even if the script times out, the script will carry on sleeping until the key is deleted, no matter how long it takes.

After the jump is an example of my code so you can see what we did to get around this :)

Continue reading

Enteo: What the hell is a mscreate.dir folder?

We are using Enteo as a deployment method for our new citrix farms at present, we are having one or two bugs but over all I’m greatly impressed with this software, its like RIS but it very functional!

Our latest issue with powerfuse is that we cant redirect the users desktop, we have the home drive mapped, the user shell registry entries but poof, no desktop redirection.

During troubleshooting we noticed these mscreate.dir folders in every single folder in our mandatory profile folder and havent a clue where they came from?!? After a bit of digging around Enteo creates these files as logs for the uninstallation of software deployed through Enteo. We were using an Enteo script to copy the mandatory profile to the %systemdrive% of every citrix server allowing the manadatory profile to be loaded quickly from local disk.

Now that we know what the folders are we dont mind them too much, but if you do choose to remove them, simply open the folder you have copied down with enteo and execute this batch command to remove them:

del /s /f mscreate.dir

Nothing else to report at the moment, well lots to report but not enough time :)

Toodles.

How to install server 2003 r2 disk 2 Silently.

During out Enteo rollout we were faced with a problem of how to either A: stop server 2003 from prompting us to install cd or B: just install the useless cd to register the operating system as R2. After a bit of digging, and some help from a very friendly consultant called Hans from Frontrange, we came up with the following method.

You need to create a .CAB file of the entire cd of r2, extract it using extract.exe to the root of the c drive, run the installation then delete the extracted files (if you wish).

Sounds simple eh? you have no idea how much of a pain in the backside this was. Firstly ill put this out there for anyone who tries to use the CRAPPY utilities by microsoft for creating cab files, DONT BOTHER. After 2 hours of tinkering and scripting the steaming pile of useless cab files was quite proportionate.

To answer this question to anyone googling, here it is:

How do i create a cab file from a source folder? Use tugzip. One problem with tugzip and cabs its seems to hang on 100% with the only option to cancel, this seems to be normal, so just wait for 2-3 mins on 100% then cancel away.

The only problem here is that if you have the files above the c: prompt the files will not install correctly, tugzip remembers the path of the zipped files after the drive prompt, so if you zipped c:mydocs2003r2 extract will put them back in that exact folder.

Heres what you do:

  • copy your installation files to a folder anywhere on your disk.
  • use the subst command to map the folder to the root of a free drive (subst z: c:mydocs2003r2)
  • now browse to the z: drive and use tugzip to create your archive file.

you can of course bypass all the above if you place the cd in the drive and use the cd’s drive letter ;) its amazing how simple an answer that WOULD have been if i had thought of it.

Once you have done that, its simple scripting time!

copy servernamesharenameextract.exe c:
copy servernamesharename2003r2cd2.cab c:
c:extract.exe /E 2003R2CD2.cab /L c:2003R2CD2 /y
C:2003R2CD2CMPNENTSR2setup2.exe /q /a /p:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx /sr
rd c:2003R2CD2 /s /q
del extract.exe
del 2003R2CD2.cab

TADA ;)

your server (post reboot) should report server 2003 r2 correctly. Might be worth noting that server 2003 enterprise and standard do NOT share the same cd. So if you have an environment with both, time to repeat the above steps for the other cd.