Archive for May, 2012

Hidden Folders In Finder (OS X 10.7)

Here’s something interesting that happened on my iMac after a restore procedure using Carbonite.


I had to restore all my movies to the Movies folder, the restore process worked; however, the folders were not showing in the Finder. I dropped to the terminal and I was able to see the restored folders.

I asked around and none of the commands I was given allowed me to display the subfolders in the Movies folder.

This command did the trick for me (once in the Movies folder type).

chflags -R nohidden *

I ran the previous command as the user, no need to sudo or reload Finder or anything else – it just works.

Leave a comment

OS Deployment – Computer Name from Asset Information

In a previous blog post, I modified a script to prompt to a computer’s name during a SCCM 2012 OS Deployment.

This new modified script basically takes the asset information (this isn’t the Asset Tag!) from our DELL computers and uses this information as the new computer name for the device being imaged.


Note: For DELL devices, you need to download DELL’s asset utility to assign an asset number/name to your devices. Sometimes this is automatically done by DELL when companies request it.
Link to updated script is here.


I’m going to over some of the more important details about this script.


Section 1



‘ Win32_SystemEnclosure is the class that contains the SMBIOSAssetTag property
‘ SMBIOSAssetTag property holds the Asset Tag information for the system
Set colSMBIOS = objWMIService.ExecQuery(“Select * from Win32_SystemEnclosure”,,48)


This is the WMI class (Win32_SystemEnclosure) that actually has the information that I’m looking for – the asset information.


Tip: Open a Command Prompt and type wmic then type SystemEnclosure. Now scroll to the right and you’ll see SMBIOSAssetTag column, and below it you should see the asset information assigned to this device. Again, although this labeled as SMBIOSAssetTag, it doesn’t make reference to DELL’s asset tag information, rather to the asset information that you assign using DELL’s utility.


Section 2



‘ Retrieve Asset Tag value from SMBIOSAssetTag
For Each ObjSMBIOS in colSMBIOS
sBiosAssetTag = ObjSMBIOS.SMBIOSAssetTag
Next


The information retrieved is a data collection, so we’re going to use a For..Next loop to retrieve only the data we need, in this case – SMBIOSAssetTag. This information is assigned to our variable sBIOSAssetTag


Section 3


If sBiosAssetTag = “” then
MsgBox “Asset tag has not been set!” & vbCr & “Go back and run DELL’s asset utility.” & vbCR & “Reboot to restart process…”, 0, “Missing Information”

‘ Clean up code to make sure that we log the error message
bExitCode = False
End If


I want to make sure that I, in fact, have assigned an asset information to this device. In the event that I’ve forgotten to run DELL’s asset utility, this section will notify me of such event.


Section 4

‘ We’re converting the name to all uppercase and assign it to OSDComputerName variable
oTaskSequence(“OSDComputerName”) = UCase(sBiosAssetTag)


In my case, I’m converting the value of of sBIOSAssetTag variable (which is a string) to all uppercase, then, this is assigned to our Configuration Manager/TS WMIC variable OSDComputerName.


That’s pretty much it.

Leave a comment

Create New Local Administrator From Command Line

The following command line tools will allow you to:

  1. Create a new local user account
  2. Set the account from step 1 to password never expire
  3. Add the account from step 1 to the local “Administrators” group

net user /add

wmic useraccount where “Name=’‘” set PasswordExpires=false
net localgroup Administrators %computername%\ /add
I used these commands during a Task Sequence in SCCM 2012.

1 Comment