RE: Adding Groups on the basis of text in a VBScript



Hi Mark

Thanks for getting back to me!

We can break the issue down into the following steps.

Firstly we need to read multiple text files, which are acting as logon
scripts.
All we need to determine from EACH of these text files is whether either or
both of the following two strings are present.

WshNetwork.MapNetworkDrive "G:", "\\***\DataLink"
WshNetwork.MapNetworkDrive "K:", "\\***\AppLink"

If the Datalink string is present the filename of the file being read should
be appended to a datalink text file.

If the Applink string is present the filename of the file being read should
be appended to an applink text file.

And thats it!

Thanks,
Verge



"Mark" wrote:

> Hi Verge,
>
> Not entirely sure what you are asking. If you trying to do a "If member of
> group then" in vbs, then the below should do it.
>
> set adinfo = CreateObject("ADSystemInfo")
> Set objuser = GetObject("LDAP://"; & adinfo.UserName)
> Const domainadmin = "CN=Domain Admins"
> Const anothergroup = "CN=Another Group"
> strGroup = Join(objUser.MemberOf)
> If InStr(strGroup, domainadmin) Then
> WScript.Echo " You are a member of Domain Admins "
> end if
> If InStr(strGroup, anothergroup) Then
> WScript.Echo " You are a member of Another Group"
> end if
>
> Let me know if I am answering the wrong question here :)
>
> Thanks,
>
> Mark
>
> "verge" wrote:
>
> > User drive mappings are currently assigned through individually created logon
> > scripts which utilize vbscript.
> >
> > These drive mappings will now be assigned through two GPOs, which have each
> > have an associated group.
> >
> > My task is to assign particular groups to the users in question based on the
> > uniform text in each users logon script.
> >
> > Possible? Easy?
> > Please let me know
> >
.



Relevant Pages

  • Re: FOF_NO_UI Constant
    ... Incidentally, below, I've copied the notes on each member from the ... This string must be double-null terminated. ... pFrom As String ... the pTo member is also a double-null ...
    (microsoft.public.vb.winapi)
  • Re: FOF_NO_UI Constant
    ... The FileOperationFlags Enum uses its own constants to declare the ... Incidentally, below, I've copied the notes on each member from the Microsoft ... This string must be double-null terminated. ... pTo must meet the following specifications: ...
    (microsoft.public.vb.winapi)
  • RE: Login scripts not executing
    ... We are using windows 2003 in bothe the forests. ... We are not using Group Policy for logon scripts, ... controller and given the path in the user properties-profiles-logon scripts. ...
    (microsoft.public.win2000.active_directory)
  • Re: VB NetAPI User Account Validation
    ... LogonUser does a local logon for a user. ... > (ByVal lpszUsername As String, ByVal lpszDomain As String, ByVal ... > rtn = NetUserChangePassword(StrConv(Domain, vbUnicode), StrConv(UserName, ...
    (microsoft.public.vb.winapi)
  • Re: Using C# XML comments to document
    ... // returns a class name based on the type of member ... public string className ... <!-- Template for Summary, Remarks, Returns, or Value tags ...
    (microsoft.public.dotnet.framework)