How to check DFS mode? (script/command line)
hi
there quick way to, programmatically or otherwise, show dfs mode namespace using?
i'm looking way work on deployments of dfs. preferably command line, vbscript or powershell. haven't been able find using dfscmd or dfsutil, may have overlooked something.
in 2008 example can right click namespace , select properties, , it's diplayed in description bar. in other words, particular solution not i'm looking for. other appreciated.
andreas
there quick way to, programmatically or otherwise, show dfs mode namespace using?
i'm looking way work on deployments of dfs. preferably command line, vbscript or powershell. haven't been able find using dfscmd or dfsutil, may have overlooked something.
in 2008 example can right click namespace , select properties, , it's diplayed in description bar. in other words, particular solution not i'm looking for. other appreciated.
andreas
i ended writing script check prescence of msdfs-schemamajorversion attribute last week. here's current version:
if instr(1, wscript.fullname, "wscript.exe", vbtextcompare) set objshell = wscript.createobject("wscript.shell") objshell.run "cmd /k cscript.exe """ & wscript.scriptfullname & "" wscript.quit end if set objrootdse = getobject("ldap://rootdse") set objsysinfo = createobject("adsysteminfo") const mode_dfs2000 = "(windows server 2000 mode)" const mode_dfs2008 = "(windows server 2008 mode)" const mode_error = "(could not determine mode)" strdomaincomponents = objrootdse.get("defaultnamingcontext") strdomainfqdn = objsysinfo.domaindnsname set objdfs = getobject("ldap://cn=dfs-configuration,cn=system," & strdomaincomponents & "") each dfsnamespace in objdfs on error resume next if isempty(dfsnamespace.get("msdfs-schemamajorversion")) wscript.echo "\\" & strdomainfqdn & "\" & dfsnamespace.cn & vbtab & mode_dfs2000 elseif not isempty(dfsnamespace.get("msdfs-schemamajorversion")) wscript.echo "\\" & strdomainfqdn & "\" & dfsnamespace.cn & vbtab & mode_dfs2008 else wscript.echo "\\" & strdomainfqdn & "\" & dfsnamespace.cn & vbtab & mode_error end if on error goto 0 next not sure if it's best way it, far can tell, it's working , job.
andreas
Windows Server > File Services and Storage
Comments
Post a Comment