I am writing a script that takes the output of UNIX script I wrote that gives the username and number of connections he/she has to the server. It then takes those names and in Windows uses a little Win32:OLE magic to determine thier department based on the users description in Active Directory.
The problem is this: our usernames in UNIX are only 8 charecthers long whereas in Windows there are as long as the user's name is. ie
Real name: George Washington
Unix name: gwashing
Windows name: gwashington
My script works fine for someone who's name is <= 8 letters, but more than that and I get an error.
I was thinking of doing a _DATA_ entry at the bottom of the script like:
_DATA_
gwashing = gwashington
so that whenever one of these names pop up (there are about 15) the script will replace the name with the correct windows name (but I have no idea where to start on that one).
The other thing I was thinking was to do something like:
if ($name == gwashing)
{ $name = gwashington}
But that would make the script run forever and that's just bad coding anyway.
It's the end of the day and I'm fried from just getting what I got so far.
I'll probably dream up something in my sleep but in the meantime if someone has a better suggestion, I'll gladly take it.
Thanks for your help,
wraheem
The problem is this: our usernames in UNIX are only 8 charecthers long whereas in Windows there are as long as the user's name is. ie
Real name: George Washington
Unix name: gwashing
Windows name: gwashington
My script works fine for someone who's name is <= 8 letters, but more than that and I get an error.
I was thinking of doing a _DATA_ entry at the bottom of the script like:
_DATA_
gwashing = gwashington
so that whenever one of these names pop up (there are about 15) the script will replace the name with the correct windows name (but I have no idea where to start on that one).
The other thing I was thinking was to do something like:
if ($name == gwashing)
{ $name = gwashington}
But that would make the script run forever and that's just bad coding anyway.
It's the end of the day and I'm fried from just getting what I got so far.
I'll probably dream up something in my sleep but in the meantime if someone has a better suggestion, I'll gladly take it.
Thanks for your help,
wraheem