finally i got solution to read nested group.
'On Error Resume Next
'Set objADSysInfo = CreateObject("ADSystemInfo")
'strUser = objADSysInfo.UserName
'Set objUser = GetObject("LDAP://" & strUser)
'For Each strGroup in objUser.memberOf
' Set objGroup = GetObject("LDAP://" & strGroup)
' Wscript.Echo objGroup
' Wscript.Echo objGroup.CN
' GetNested objGroup
'Next
dim temp
Set d = CreateObject("Scripting.Dictionary")
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_1779 = 1
Const ADS_NAME_INITTYPE_SERVER = 2
Const ADS_NAME_INITTYPE_DOMAIN = 1
Wscript.Echo "==================================================="
Set objNetwork = WScript.CreateObject("WScript.Network")
'strUserName =objNetwork.Username
strUserName ="laxjoshi"
wscript.echo strUserName
strComputerName = objNetwork.ComputerName
strUserDomain = objNetwork.UserDomain
Set objUser = GetObject("WinNT://" & strUserDomain & "/" & strUserName & ",user")
strGroupList = ""
For Each objGroup In objUser.Groups
'wscript.echo objGroup.Name
strGroupName=objGroup.Name
Set objTrans = CreateObject("NameTranslate")
objTrans.Init ADS_NAME_INITTYPE_DOMAIN, strUserDomain
strNTName = strUserDomain & "\" & strGroupName
objTrans.Set ADS_NAME_TYPE_NT4, strNTName
strGroupDN = objTrans.Get(ADS_NAME_TYPE_1779)
' Escape any forward slash characters, "/", with the backslash
' escape character. All other characters that should be escaped are.
strGroupDN = Replace(strGroupDN, "/", "\/")
'wscript.echo "strgroup="& strGroupDN
' strGroupDN = "LDAP:
'wscript.echo "strdn="& strGroupDN
Set objGroup = GetObject("LDAP://" & strGroupDN)
'Wscript.Echo objGroup
Wscript.Echo objGroup.CN
strgroupname=objGroup.CN
'If IsMember(strUserDomain,strUserName,strgroupname) Then
' Wscript.echo "The user '"& strUserName &"' exists in the group '"&strgroupname&"'"
'Else
' Wscript.echo "The user '"&strUserName&"' not exists in the group '"&strgroupname&"'"
'End If
'd.add objGroup.CN
GetNested objGroup
'adsPathNT2DN = strGroupDN
'Set ngrp = GetObject("WinNT://" & strUserDomain & "/" & objGroup.Name & ",group")
'For Each member In ngrp.Members
'wscript.echo member.name
'If (StrComp(UCase(member.Class), "GROUP") = 0) Then
'wscript.echo "Group name="& member.name
'end if
'Next
'wscript.echo "=================================================="
next
wscript.echo "=================================================="
'If IsMember(strUserDomain,strUserName,State) Then
' Wscript.echo "The user '"& strUserName &"' exists in the group '"&State&"'"
'Else
' Wscript.echo "The user '"&strUserName&"' not exists in the group '"&State&"'"
'End If
'*************************************************************************
' *****************************************************
'This function checks if the given AD user is member of the given group.
Function IsMember(domainName,userName,groupName)
Set groupListD = CreateObject("Scripting.Dictionary")
groupListD.CompareMode = 1
ADSPath = domainName & "/" & userName
Set objUser = GetObject("WinNT://" & ADSPath & ",user")
For Each objGroup in objUser.Groups
groupListD.Add objGroup.Name, "-"
Next
IsMember = CBool(groupListD.Exists(groupName))
End Function
'******************************************************************************
'******************************************
Function GetNested(objGroup)
On Error Resume Next
colMembers = objGroup.GetEx("memberOf")
For Each strMember in colMembers
strPath = "LDAP://" & strMember
Set objNestedGroup = GetObject(strPath)
strGroupList = objNestedGroup.CN
if strGroupList <> "" and temp <> strGroupList then
temp=strGroupList
'strGroupList = Replace(strGroupList, "CN= ", "")
strGroupList=trim(strGroupList)
d.add strGroupList
wscript.echo ">>>>>"& strGroupList
End If
GetNested(objNestedGroup)
Next
End Function