Solved

vbscript ucase statement help

Posted on 2016-08-02
3
35 Views
Last Modified: 2016-08-07
I have a script that is running a subroutine and comparing the user account/s in active directory against a list in sharepoint.  It works fine with the exception of a nested group within one of the global groups.  My user id's are all numbers so I'm thinking I may need to specify with a ucase statement but am stuck on what the syntax would be.

Here is the sub routine, "fline=mid(fline,5,len(fline)) " below is where I'm think I need to insert.

Sub getuser(ADUsers,groupname,strpath)
          runline =  "cmd.exe /c dsquery group dc=mcd,dc=pri -name "&groupname&" | dsget group -members > " & Chr(34) & strpath & Chr(34)
          WShshell.Run  runline,0,TRUE
          set ofile=objfso.opentextfile(strpath,1)
          count=0
          Do While Not oFile.AtEndOfStream
                   Fline = oFile.Readline
                   if mid(fline,2,3)="CN=" then
                             endofline=instr(fline,",")-1
                             fline=Left(fline,endofline)
                             fline=mid(fline,5,len(fline)) 'Userid = UCASE(userid)

                             If Not ADUsers.Exists(Fline) Then
                                      ADUsers.add Fline , 0
                             End If
                             count=count+1
                   END if
          loop
          ofile.close
end sub

Open in new window

0
Comment
Question by:Rob Shorts
  • 2
3 Comments
 
LVL 54

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 41739583
Have you tried:

fline=UCase(mid(fline,5,len(fline)))

Open in new window

~bp
1
 

Author Comment

by:Rob Shorts
ID: 41739594
Perfect!  Thank you Bill P
0
 
LVL 54

Expert Comment

by:Bill Prew
ID: 41739599
Welcome.

~bp
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question