Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Read file from text in vb script

$
0
0

Hi  i have a vb script 

Option Explicit

Dim objADObject, strOwner, objSecDesc

' Specify the owner.
strOwner = "MyDomain\jsmith"

' Bind to the AD object.
Set objADObject = GetObject("LDAP://cn=Test Group,ou=Sales,ou=West,dc=MyDomain,dc=com")

'Bnd to the security object.
Set objSecDesc = objADObject.Get("ntSecurityDescriptor")

' Assign the owner.
objSecDesc.Owner  = strOwner

' Save change.
objADObject.Put  "ntSecurityDescriptor", objSecDesc
objADObject.SetInfo

and i want to do it for some computer that store in the text file how can achieve this ?

test file is  :
"CN=HY-ZAHEDI02,CN=Computers,DC=contoso,DC=local""CN=HY-ZAHEDI01,CN=Computers,DC=contoso,DC=local""CN=CLIENT01,CN=Computers,DC=contoso,DC=local""CN=SERVER02,CN=Computers,DC=contoso,DC=local""CN=SERVER03,CN=Computers,DC=contoso,DC=local""CN=CLIENT-PC,CN=Computers,DC=contoso,DC=local""CN=FILESERVER01,CN=Computers,DC=contoso,DC=local""CN=FILESERVER02,CN=Computers,DC=contoso,DC=local""CN=CLUSTER-FILESER,CN=Computers,DC=contoso,DC=local""CN=FS-CL2012,CN=Computers,DC=contoso,DC=local""CN=CLUSTER1,CN=Computers,DC=contoso,DC=local""CN=FILESERVER03,CN=Computers,DC=contoso,DC=local""CN=CLUSTE01,CN=Computers,DC=contoso,DC=local""CN=CUSTER01,CN=Computers,DC=contoso,DC=local""CN=CL,CN=Computers,DC=contoso,DC=local""CN=HY-CL,CN=Computers,DC=contoso,DC=local"

thanks for helping me .


I Love God,because he help me to find Technet.


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>