At the new job, I’m running a small domain for field users. At the old job, EDS had a nifty script that would put the user’s computer name into the office field. I decided to recreate that today because I’m needing to back up computers and I don’t have an index of who’s using which computers readily available. For any who might be interested, here’s the code:
// ComputerName.js - Set the computer name into the Office field in
// Active Directory
// Author - Jace Gregg
// Version 1.0 - 12 November 2008
// -----------------------------------------------------------------
var cTITLE = "Dawson Scripting: Computer Name";
try {
var username = ParseEnvironStrings("%username%");
var computername = ParseEnvironStrings("%computername%")
var cn = "";
var conn = WScript.CreateObject("ADODB.Connection");
var cmd = WScript.CreateObject("ADODB.Command");
conn.Open("Provider=ADsDSOObject;");
cmd.ActiveConnection = conn;
cmd.CommandText = "<ldap ://dc=dawsonfield,dc=local>;(&(objectCategory=User)(samAccountName=" + username + "));samAccountName,cn;subtree";
var rs = cmd.Execute();
if(rs.RecordCount == 0) {
msgbox("sAMAccountName: " + username + " does not exist.");
}
else {
cn = rs.Fields("cn");
msgbox(cn);
}
var objUser = GetObject("LDAP://cn=" + cn + ",ou=FieldUsers,dc=dawsonfield,dc=local");
objUser.Put("physicalDeliveryOfficeName", computername);
objUser.SetInfo();
rs.close();
conn.close();
}
catch(e) {
msgbox("Error " + e.number + "\n\n" + e.description + "\nCould not update computer name.");
}
function msgbox(message, title) {
if(title == null) {
title = cTITLE
}
var objWSH = WScript.CreateObject("Wscript.Shell");
objWSH.Popup (message, 10, title);
}
function ParseEnvironStrings(strInput) {
var WshShell = WScript.CreateObject("WScript.Shell");
return WshShell.ExpandEnvironmentStrings(strInput);
}
Save it as a .js file and run it as a startup script with group policy or some other way. Feel free to use this in your own projects/work. Took me an hour to figure it out, so I imagine someone else might need it too.
I upgraded this blog to the new version of WordPress. I’d kinda like to do some writing again and will be moving it to another host before too long. Got to get a design I like and make it a theme, then go from there. There’s been a lot happen over the past year, and I’m hoping to write about some of it. So stay tuned and don’t be too worried if this page disappears for a few hours at a time.
Comments Off
At some point in the last two weeks, Amazon unleashed a vinyl store, and I’m just finding out about it today. In case you were wondering, there goes my afternoon.
Comments Off
We have a help desk here at my company. It’s a help desk that all users of the entire global operation can call for things like password resets, email server issues, connectivity issues, etc. For years this help desk was located at a typical midwestern town in Ohio. Recently, our service provider has begun outsourcing the first option (password resets, outages and printer problems) to some unknown company in India (probably Sitel, but I’m not too sure about that). The associates in India are, shall we say, incompetent, at best. What once took a five minute phone call now takes 75 minutes on the phone with a hardly understandable individual and a day to replicate through the clouds of networks.
The vendor contracted to service our company’s computer needs, however, is not the only company to do this. We have begun outsourcing some pieces of our processes. I think this is one of the poorest ideas a company can implement. Customer service is immediately presented as a second thought when you are forced to speak to someone in a different country. It personifies a company’s greed. The customer should always take priority over saving a few dollars an hour. A company will protect a more loyal customer base, ensure a higher level of service quality and foster growth of new customers simply by refraining from outsourcing.
For those as yet unaware, the wedding went off without a hitch. Except for me and Mandy getting hitched, I guess. Wow, I didn’t used to write so bad. Shucks! It seems marriage has had a negative influence on my writing! Curious, to say the least.
One might think that such an important change in one’s life would give one an awful lot of material on which to write. One would be wrong. The only thing I really have to say is that if one more person asks what married life is like, I’ma have to go postal. Marriage is like, the same as it was before being married, except I don’t have to take Mandy to someone else’s house after a date. And we havea the sex with God’s blessing. And I can grab her butt in public, and, though she gets embarrassed, it’s totally legal.
The only weird thing is hearing “Mandy Gregg”, and the occasional “Mrs. Gregg”. It’s creepy. Her name’s Mandy and there’s no need to use her last name except in legal circumstances.
So that’s what’s going on with me. Oh and I got “promoted” to Operations Support Supervisor. It’s the same job with a little more money (about as much as I got on big OT paychecks, but salaried so I get ‘em all the time now) and a whole lot less to worry about (no clocking in and out for lunch, etc.). I’m still a corporate whore, though. Woot.