Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

domain users list


  • Please log in to reply
6 replies to this topic

#1 Joeykong

Joeykong

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:08:09 AM

Posted 27 February 2017 - 03:14 PM

i was wondering if there is a way to see what pc(by the host name ) are logged into the domain

my old boss when deploying pc's would just use the generic username "user "  so we had like 100+ pc all logged in under the username "user" we took alot of our PC's off the domain but did not get all of them and rather then walking all around and checking is there a CMD or powershell command or a script or anything that can be ran to eaisly tell us what pc's are connected to the domain 

 

if we can get all pc's by host name that are connected to the domain it would save us the time and energy walking around to all the pc's in the building (450+pc's)

in a text file that would be great 

if there was a way to take it farther and have it be like 

salespc1(host name ) is logged in with "user "(what ever domain account it is logged into ) that would be even better

 

iv tried the following script 

net view /domain:********>> C:\PM\domainpc's.txt
 
pause
 
 
it gave a list of pc's but some of them im sure are not (or atleast should not be ) on the domain anymore 
 
thanks in advanced for any help 


BC AdBot (Login to Remove)

 


#2 Kilroy

Kilroy

  • BC Advisor
  • 3,335 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Launderdale, MN
  • Local time:02:09 AM

Posted 27 February 2017 - 04:22 PM

Any script would have to be created for how your Active Directory tree is organized.

 

You could take your domainpcs.txt file and then ping the machine to see if they are on line.  This code will ping all of the machines in the file comptuer.txt and then create a new file called results.txt with the results from the ping.

for /f "tokens=1 delims=\\" %%I in (computer.txt) do call :pinger %%I
goto :eof 
:pinger 
ping -n 1 %1 | findstr /c:"Pinging " /c:"Reply from " /c:"Please check " >> results.txt
:: DONE

Then you can run this code.  To create two files found.txt and not_found.txt to get a list of machines that are currently on line, they will be in the found.txt file.

findstr "Please check" results.txt >> not_found.txt
 
findstr "Pinging" results.txt >> found.txt

Edited by Kilroy, 27 February 2017 - 04:23 PM.


#3 Joeykong

Joeykong
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:08:09 AM

Posted 27 February 2017 - 05:27 PM

so this is what i got i am running all this from my pc (not domain controller ) my is how on the domain tho not sure if these needs to be run from domain controller 

 i ran the things on my pc and i got it to work only thing is there is pc's that were found that im 99.9%sure that are not on the domian anymore 

some of the pc's we have as mycompany as a work group and others that are actually on the domain would say mycompany.com

 

i tired adding the .com into the 1st net view command but i get a error 



#4 Wand3r3r

Wand3r3r

  • Members
  • 2,027 posts
  • OFFLINE
  •  
  • Local time:12:09 AM

Posted 27 February 2017 - 07:11 PM

if using a dhcp server the host names will be listed there.



#5 Joeykong

Joeykong
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:08:09 AM

Posted 28 February 2017 - 08:52 AM

so on the DHCP server i should be able to see if they are on domian or a workgroup ?

part of the issue is im 2nd in command at my job and my boss is telling me the only way to do this is to walk around to each pc

 

even tho iv suggested a few things that would work like the PM script i use exports a bunch of system info including the host name and if the pc is on the domain or a work group i send those txt files to a gmail so we could just look trough those and find out

also i suggest using our bit defender gravity zone control center that also seems to show if the pc is on the domain via the FQDN filter then to corss reference that with the list i got awhile ago and the PM sheets it make it pretty easy but he is saying that wont work ...

 

so if there is a command script ect that would be perfect 



#6 Kilroy

Kilroy

  • BC Advisor
  • 3,335 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Launderdale, MN
  • Local time:02:09 AM

Posted 28 February 2017 - 03:04 PM

Part of your issue is that since some machines are workgroup and some are domain you can only do things based upon machines on line at the time.

 

Any device receiving an address from DHCP will show up on the DHCP server.  The problem is going to be getting the information out.



#7 Joeykong

Joeykong
  • Topic Starter

  • Members
  • 24 posts
  • OFFLINE
  •  
  • Local time:08:09 AM

Posted 01 March 2017 - 02:35 PM

Part of your issue is that since some machines are workgroup and some are domain you can only do things based upon machines on line at the time.

 

Any device receiving an address from DHCP will show up on the DHCP server.  The problem is going to be getting the information out.

so from your script i ran it on my pc 

then i went through the FOUND file and used my PM files (these include the host name and domain ) and it seems like there is about 28 total machines connected to the domain witch seems right as my list of people last year shows 25 but that didnt include servers but walking around to 20 something pc's is fine rather then going to 400+

 

 

 

see the full story is 2 years ago boss 1 had me and my co-worker go around and remove people off the domain (we did not finish this task ) as boss 1 got fired ..my co worker became boss 2 and because we needed to take on alot more responsibility's we forgot about the domain task last year i removed a lot more people off the domain ... but we left a hand full of people on for various reasons ....boss 2 is convinced we took everyone off back in 2015...witch is untrue lol but anyway he is saying we did not migrate people off correct and they logged back in with a domain profile witch again is false ... this is how we took people off 

 

 
 this is how we took people off 
migrate domain users
1 log in as domain user 
2.create local user (start right click my computer click manage user create the user make sure you check password never expires)
 make that user admin (start-control panel-user accounts-manage user accounts-make local account admin)
 3.log off domain user and log in as local.\(local user name)
4 open regedit .. start type reg edit hit enter (xp start run regedit hit enter)
5. go to hkey_local_machine-software-microsoft-windowsNT-current version-profilelist
6.export profilelist
7.find the domain user profile and copy the profile image path
8. delete the domain user reg
9. find the local user reg paste the domain user path into the local profile image path
10.close everything reboot and log-in as local user
11.when you log in all files background ect should now be there
12. leave domain reboot and log into the local user again confirm everything transferred 
 
 
step 12 would make it impossible for them to log into a domain profile because they are no longer on the domain (right ?)





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users