Search Windows and Linux Networking

Showing posts with label Windows 2008 Server Core. Show all posts
Showing posts with label Windows 2008 Server Core. Show all posts

Thursday, September 21, 2017

Getting Windows Client Basic Information from Command Line.


Getting windows client some basic information from command line quickly. 




1) Quickly get computer Hostname and domain information.
systeminfo | findstr /c:"Host Name" /c:"Domain"
 2) quickly get OS information
systeminfo | find "OS"
3) Quickly get System information 
systeminfo | find "System"
OR
 systeminfo | find "System" & wmic bios get serialnumber
4) Quickly get DNS client configuration
ipconfig /all | Findstr /c:"Dns" /c:"DNS" 
5) Quickly get DHCP client configuration
ipconfig /all | Findstr /c:"DHCP" /c:"IPv4" 
6) Quickly get Memory information. 
systeminfo | find "Memory"

Friday, November 15, 2013

How to Search All Disabled User In Active Directory.

How to Search all Disabled User In Active Directory and export in to the Excel File using VBScript.


OR

 How to Search all Active/Enabled User In Active Directory and export in to the Excel File using VBScript


There are some time when you needed or your manager ask to provide all Disabled user Or currently all Active User from Active Directory in excel file and there are more than 100 Accounts in your Active Directory and you have to give all information in limited time frame. then best option is to use VbScript that search all disabled or All Active/Enabled users in Active Directory.

Following is the VBScript that Search for all Disabled Users in entire domain.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Option Explicit
Dim objRootDSE,strDNSDomain,adoConnection,strQuery,adoRecordset,Field
Dim CN,FirstName,LastName,initials,Descrip,EmailAddr
Dim strFileName, ObjExcel, intRow

'Search all Disabled users in Active Directory and export them in to Excel file.


wscript.echo "Searching all disabled users in Active Directory please wait...."

'Open Excel file to Write the Data

Set ObjExcel = CreateObject("Excel.Application")
objExcel.Visible = True
objExcel.WorkBooks.Add()
intRow = 1
       ObjExcel.Cells(intRow,1).Value = "CN"
       ObjExcel.Cells(intRow,2).Value = "FirstName"
       ObjExcel.Cells(intRow,3).Value = "initials"
       ObjExcel.Cells(intRow,4).Value = "LastName"
       ObjExcel.Cells(intRow,5).Value = "EmailAddr "

' Bind to Domain or OU

Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
Set adoConnection = CreateObject("ADODB.Connection")
adoConnection.Provider = "ADSDSOObject"
adoConnection.Open "ADs Provider"
strQuery = "<LDAP://" & strDNSDomain & ">;(&(objectCategory=person)(objectClass=user));adspath;subtree"

'Define condition for search
Set adoRecordset = adoConnection.Execute(strQuery)

' Loop to search users through them...


Do While Not adoRecordset.EOF
     Set Field = GetObject(adoRecordset.Fields(0).Value)
     If Field.accountDisabled = TRUE Then
       'wscript.echo "Account " & Field.displayname & " is disabled"
       intRow = intRow + 1
       Cn = Field.CN
       FirstName = Field.GivenName
       LastName = Field.sn
       initials = Field.initials
       Descrip = Field.description
       EmailAddr = Field.mail

       'Wscript.echo "Users full Name is " & FirstName & " " & initials & " " & LastName & " and his Email ID is " & EmailAddr

       ' Write to Excel File
       ObjExcel.Cells(intRow,1).Value = CN
       ObjExcel.Cells(intRow,2).Value = FirstName
       ObjExcel.Cells(intRow,3).Value = initials
       ObjExcel.Cells(intRow,4).Value = LastName
       ObjExcel.Cells(intRow,5).Value = EmailAddr
     
      End If
 
adoRecordset.MoveNext

Loop
'If completed notify as it done.
wscript.echo "Done"

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++





You can also use this script to search all Active/Enabled user in entire domain by just modifying condition Field.accountDisabled = TRUE with Field.accountDisabled = FALSE

OR

You can also use this script to find all Active/Disalbed users by just modifying Bind base string (strQuery ) using Organization Unit. For example

strQuery = "<LDAP://OU=DisabledAccounts,DC=Example,DC=com>;(&(objectCategory=person)(objectClass=user));adspath;subtree"

I hope this will help you. :-)

Thursday, October 24, 2013

How to disabled IPv6 on Windows 2008 Server from registry

Step to permanently disabled IPv6 from Windows 2008 Server or windows 7.


If you do not required IPv6 on your windows 2008 Server system or windows 7 Desktop you can disabled it from registry.



To disabled IPv6 support go to:-

login in to the server/Desktop with user member of Administrator group and follow the step

 Start> run > and type regedit. Expand the path

Coputer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\TCPIV6\Parameters

Now Right Click the folder Parameters and Select New > DWORD(32-Bit) Value > Name the key as DisabledComponents
Now open the DisabledCompontents key and type ffffffff and click ok.<8 time " f " with lower case >

Final setting look like this:-



Now close the all application and restart your server/Desktop.


After reboot check IPv6 disappear from command result ipconfig /all

Wednesday, July 25, 2012

How to Map (Mount) NFS Share in Windows

If you wanted to use Linux NFS Share from Windows system to mount as drive. You can do it using mount command for that you need to install NFS Client for windows.

Installing NFS Client :-

If you are windows7 , Vistra, or Windows 2008 user then you can install NFS Client from Add/Remove Software wizard in the Control Panel.

If you are Windows 2000, Windows 2000 Service Pack 3, Windows 2000 Service Pack 4, Windows Server 2003, Windows XP user then you can download client from following location.
http://www.microsoft.com/en-us/download/confirmation.aspx?id=274






And the select Finish

After installation check if NFS service is running or not from service MMC

Start -> Run -> Services.msc




If require service is running on your system you can now Map (Mount) NFS share from command line using mount command:

mount servername:\Share_Name Drive_Letter

For Example: your server name is FileServer and you have NFS export /home/share and you wanted map this drive as Z: in your My computer, then command look like this:



Start -> Run -> CMD -> OK -> Mount FileServer:\home\share Z:


Mount FileServer:\home\share Z:

It will map your NFS Share in your system and it ready to access as disk drive from you my computer.

Note:- If your NFS share required Authentication you can provide it with mount command. 


 

 



Friday, March 23, 2012

VBScript for checking an Active Directory disabled users are hide in Global Address list or not.

VBScript for checking an Active Directory disabled users are hide in Global Address list or not.



Option Explicit
Dim objRootDSE,strDNSDomain,adoConnection,strQuery,adoRecordset,Field

'Check if Active Directory disabled users are hiden or not in Global Address list

wscript.echo "Searching all disabled users to check if they are hide in GAL or not please wait...."

Set objRootDSE = GetObject("LDAP://RootDSE")

strDNSDomain = objRootDSE.Get("defaultNamingContext")

Set adoConnection = CreateObject("ADODB.Connection")

adoConnection.Provider = "ADSDSOObject"

adoConnection.Open "ADs Provider"

strQuery = "<LDAP://" & strDNSDomain & ">;(&(objectCategory=person)(objectClass=user));adspath;subtree"

Set adoRecordset = adoConnection.Execute(strQuery)

' Loop through them...


Do While Not adoRecordset.EOF
     Set Field = GetObject(adoRecordset.Fields(0).Value)
     
     
     If IsArray(Field.proxyAddresses) and Field.accountDisabled = TRUE and Field.msExchHideFromAddressLists <> TRUE Then
      
       wscript.echo "Account " & Field.displayname & " is disabled but not hide in Global Address list"
          
      End If
adoRecordset.MoveNext
Loop
wscript.echo "Done"

Wednesday, January 18, 2012

Install & Configure DHCP Server role on Windows 2008 Server Core

DHCP Server is very important server in the network environment. We can install & configure DHCP server role using below steps in windows 2008 server core...





1) First we will have to run below command on windows 2008 server core to add the DHCP server role.


2) Then to start DHCP service automatically, use below command...


3) Then use below command to start the DHCP service


4) If the DHCP server is in Active Directory domain environment (i.e. Member of a domain) then we must have to authorize the DHCP server to work properly.

To authorize the server in domain , use below command..


5) Now to add scope to the DHCP Server use below command


(C:\windows\system32>netsh dhcp server 192.168.127.11 add scope 192.168.127.0 255.255.255.0 scope1)

In the above command 192.168.127.11 = the IP of DHCP server

192.168.127.0 255.255.255.0 = subnet & subnet mask of scope which we have to add

Scope1 = name of the scope to be added

6) Then we will need to set the IP range for the added scope, for this use below command..


(C:\windows\system32>netsh dhcp server 192.168.127.11 scope 192.168.127.0 add iprange 192.168.127.50 192.168.127.100)

Using above command we have added IP range (192.168.127.50 - 192.168.127.100) to the scope (192.168.127.0) in the DHCP server (192.168.127.11)

7) If we want to add exclusion range to DHCP range then we have to use below command


(C:\windows\system32>netsh dhcp server 192.168.127.11 scope 192.168.127.0 add excluderange 192.168.127.56 192.168.127.60)

Using above command we have added exclusion IP range (192.168.127.56 - 192.168.127.60) to the scope (192.168.127.0) in the DHCP server (192.168.127.11)

8) To set Default Gateway (Option 003) use below command..


(C:\windows\system32>netsh dhcp server 192.168.127.11 scope 192.168.127.0 set optionvalue 003 IPADDRESS 192.168.127.1)

Using above command we have set Default Gateway address as 192.168.127.1 for the scope 192.168.127.0

9) To set DNS server (Option 006) use below command..


(C:\windows\system32>netsh dhcp server 192.168.127.11 scope 192.168.127.0 set optionvalue 006 IPADDRESS 192.168.127.10)

Using above command we have set primary DNS address as 192.168.127.10 for the scope 192.168.127.0

10) Then finally we will have to activate this scope, for this , use below command


(C:\windows\system32>netsh dhcp server 192.168.127.11 scope 192.168.127.0 set state 1)

Now your DHCP server should be running & working fine!

I hope this will help you to setup DHCP server on windows 2008 server core with ease.