When you don't even know how to write a correct path you shouldn't be allowed to have a shell login, save for the sandbox to learn. When you ask your systems administrator how to do it tell him to remove your other user accounts. You are probably endangering the continuous operation of your corporate network.
I built a command to access Id info - design goal was to provide a CSV table across many systems with user info from both Solaris n Windows!
The script is able to Create CSV file while run as root and then you can collect info by hostname across the University ‘ s platforms into a very large spreadsheet.
In doing so I noticed that getent will follow rules set for each host!
Naturally the various hosts might only need a passwd/group file, or it might also obey the wider rules which were setup by active directory servers!
This was the main problem!
Either you get a username from the passwd/group with no interference
OR you get it with Active directory plus the the system passed/group!
I found that different hosts had 3 processes at most handling your credentials. So I completed an initial draft n checked my data!
Darn! Bug! Dog gone it!
Some systems enabled 2 n others enabled 3 processes!
So I now had to work out different procedures (the answers depended up the commands required) automatically within my script per host!
So ... it is not easy in a script to have the script detect all the processes and or files which will provide the “CORRECT & COMPLETE”” information for a SECURITY sweep!
The idea is for you to check the documentation for each command you use to see if Active Directory
Plays a part!
In your case you may have a network user enabled n the same user MAY/MAYNOT be in the passwd/group files!