Hey guys!
We just recently started using Casper Suite in our organization and I've run into an issue.
Basically, we have a bunch of computers that have different LocalHost names compared to their Active Directory names. Usually, their LocalHost name is correct (meaning it shows up correctly in JSS) but the one in Active Directory is not. What is the best way of finding the wrongly named clients, rename them, unbind them and then re-bind them again?
I thought I'd do the following:
1. Grep the bound name of all clients
2. Filter out the correctly bound names
3. Create a group with the erroneous names
4. Associate them with unbindAD.sh, rename the computer using a script and then let JSS bind them again
I wrote a script that greps the computer name as shown in Active Directory:
#!/bin/sh
ADNAME=`dsconfigad -show | grep "Computer Account" | awk '{print $4}' | rev | cut -c 2- | rev`
echo "$ADNAME"
exit 0
The script works fine, I tested it on my own (correctly named) computer and the results are shown as below:
My questions is, how can I get the Script result easily? Is there a way to view the results without having to manually open the policy, click Logs and then individually click Show under each client? Can the JSS automatically email me the results? Or is there an alternative way to accomplish what I'm after?
Thanks!