Jump to content

brian873

Member
  • Posts

    335
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United Kingdom

Everything posted by brian873

  1. Thanks everyone I have it working the way I need it now. @allen2 - thats a fair point and a good one to look out for. However in this environment there are no nested groups and all usernames are generated from another system so should be fine with the current task. @Yzöwl - I have used the line you provided, thanks very much I will take a look at the other methods tools mentioned, but I can get what I need for now! Cheers
  2. Thanks jaclaz & Yzöwl OK that makes sense now. I cant test it at the moment, will do it tomorrow. My only concern would be that %groupname% in some cases will contain spaces. I think omitting the " " will cause a problem. I will report what I find.
  3. Hi Jaclaz, thanks for the reply Sorry !%newName! was a typo, it should be !newName! Ok here is the information you asked for. When the CMD file prompts for input at the line set /p groupname=enter groupname: I am entering Accounts Working CMD file @echo off CLS echo. set /p groupname=enter groupname: echo. echo. dsquery * domainroot -filter "(&(objectClass=group)(name=""%groupname%""))" -l -d DomainName -attr member >>GroupMemberExtract.txt CLS setlocal enabledelayedexpansion FOR /F "tokens=1 delims=," %%a IN ( GroupMemberExtract.txt ) DO ( set oldName=%%a set newName=!oldName:~3! echo !newName!>>GroupMemberTrim.txt ) SETLOCAL DISABLEEXTENSIONS :END GroupMemberExtract.txt GroupMemberTrim.txt Non working CMD file with vairables @echo off CLS echo. set /p groupname=enter groupname: echo. echo. dsquery * domainroot -filter "(&(objectClass=group)(name=""%groupname%""))" -l -d DomainName -attr member >>"%groupname%Extract.txt" CLS setlocal enabledelayedexpansion FOR /F "tokens=1 delims=," %%a IN ( "%groupname%Extract.txt" ) DO ( set oldName=%%a set newName=!oldName:~3! echo !newName!>>"%groupname%Trim.txt" ) SETLOCAL DISABLEEXTENSIONS :END AccountsExtract.txt AccountsTrim.txt So as you see, using the variables in this example throws out the %%a in the for loop and instead of phrasing the contents it uses the filename.
  4. Hi, I have a CMD file which extracts users from an Active Directory group then trims it so only the username is displayed in the output file GroupMemberTrim.txt. It works fine, however I would like to use dynamic file names instead of static GroupMemberExtract.txt -> %groupname%-Extract.txt GroupMemberTrim.txt -> %groupname%-Trim.txt When I change this it breaks the FOR loop so the %%a variable does not read in the contents of %groupname%-Extract.txt instead it reads the filename %groupname%-Extract.txt as the %%a variable. Does anyone have any ideas how this could be fixed? Thanks @echo off CLS :GroupsMembersExtract echo. set /p groupname=enter groupname: echo. echo. dsquery * domainroot -filter "(&(objectClass=group)(name=""%groupname%""))" -l -d DomainName -attr member >>GroupMemberExtract.txt :GroupsMembersTrim CLS setlocal enabledelayedexpansion FOR /F "tokens=1 delims=," %%a IN ( GroupMemberExtract.txt ) DO ( set oldName=%%a set newName=!oldName:~3! echo !%newName!>>GroupMemberTrim.txt ) SETLOCAL DISABLEEXTENSIONS :END
  5. Hi Guys, thanks for both your help ! Thats it working fine for me now
  6. Hi, I am looking for some help with a VB script I am trying to improve. The script runs at logon and pulls out some AD information to create an email signature for the user in Outlook 2003. The script is working fine but I would now like to add in a check so if a field is blank, it does not include that section the in signature. The issue is that not all users have fax numbers so I would like to check the fax and only include the line objSelection.TypeText "Direct Fax: " & strFax if it is not empty. Any pointers ? Full Script On Error Resume Next Set objSysInfo = CreateObject("ADSystemInfo") strUser = objSysInfo.UserName Set objUser = GetObject("LDAP://" & strUser) strName = objUser.FullName strTitle = objUser.Title strDepartment = objUser.Department strCompany = objUser.Company strPhone = objUser.telephoneNumber strFax = objUser.facsimileTelephoneNumber Set objWord = CreateObject("Word.Application") Set objDoc = objWord.Documents.Add() Set objSelection = objWord.Selection Set objEmailOptions = objWord.EmailOptions Set objSignatureObject = objEmailOptions.EmailSignature Set objSignatureEntries = objSignatureObject.EmailSignatureEntries objSelection.Font.Name = "Arial" objSelection.Font.Size = "10" objSelection.Font.Bold = True objSelection.TypeParagraph() objSelection.TypeText strName objSelection.TypeParagraph() objSelection.TypeText strTitle objSelection.TypeParagraph() objSelection.TypeText "Direct Dial: " & strPhone objSelection.TypeParagraph() objSelection.TypeText "Direct Fax: " & strFax Set objSelection = objDoc.Range() objSignatureEntries.Add "AD Signature", objSelection objSignatureObject.NewMessageSignature = "AD Signature" objSignatureObject.ReplyMessageSignature = "AD Signature" objDoc.Saved = True objWord.Quit
  7. Thanks Ponch ! I have got it now.... and thanks again Mijzelf I think I have just learned somethign new today
  8. Thanks Mijzelf great utility ! Although I would still like to know how to calculate this, anyone help my brain is thinking too hard about it and I cant find the solution.... Any help appreciated
  9. Hi I am trying to work out how long it will take to transfer a file over different networks. If I have a 50mb file how long would it take to transfer using gprs @ 80kbps and edge @ 236kbps any help would be appreciated
  10. Excel 2007 will not let me enter two ** Maybe we can continue this on monday ! Thanks for helping out.
  11. Sorry skylark53 you are loosing me here. What I would use is... 5.42 x 10 x 10 x 1- = 5420 (10 to the power of 3) Why do you use use ** twice ?
  12. Thanks again for the reply skylark53 but I think we are talking about two different things here. It is not the format I am concerned about it is how to perform the calculation.
  13. Hi skylark53, thanks for the reply. Sorry I copy and pasted he last post and the format was lost. So... 5.42 × 103 = 5,420 should have been 5.42 x 10 (to the power of) 3 = 5,420 Any ideas?
  14. Hi I would like to know how to use scientific notation in excel. Can anyone help? I'll use the following as an example. 5.42 × 103 = 5,420 Thanks brian
  15. OK got it no.... 2.4 * 1024 / 20 = 123
  16. Hi, I would like know the following.... If I have a video file that is 2.4mb and 20 seconds long how much data is transferred each second of the video? Can anyone help? I have tried the following but it doesn't look correct to me. 2.4mb = 2,400kb (2,400/20 = 120kb) Thanks brian
  17. Thanks guys ! I think I have found out what I need.... Thanks again for taking to the time to answer.
  18. Hi guys thanks for this. TARUM: I still get 7,500,000 bytes when using that utility. Thanks for that by-the-way. Can you show me how your doing the calculation? Thanks
  19. Hi RJM, thanks for the reply. I seem to have come with a different figure form you. Can anyone confirm what it right? Thanks 7.5Mb = 7,500Kb = 7,500,000 bytes = (7,500,000 x 8 bits = 60 million bits. Divide that by sixty seconds in a minute and you get a data rate of 1 million bits per second or 1Mbps.
  20. Hi I would like to know the calculation so I can work out data transfer rates on my lan. I have found online calculators that do the job but I would like to know how they do it! Any advice is welcome. Thanks brian An example would be: "It takes 1 minute to download a 7.5 MB data file. At what bit rate is the data being transferred?"
  21. Hi, from what I can gather you cannot slipstream service packs on to the small business edition of office 2003 because it will not let you create an installation point. I was wondering if there was another way round this so I could create a secure default install without having to install everything separately. Many thanks brian
  22. Thanks CTRL-X ! I'll have a read up on this. Thanks agian for your help hail hail
  23. My file as above does not work. It creates the custom folder structure in the left hand pane of PGO editor computer configuration > administrative templates > WinLogOn But in the right hand pane there are no settings. Any help would be appreciated very much
  24. thanks ctrl-x, I know about that setting. But the problem with it for me, is it gives you an extra click. If you use the above script it puts the text on the same screen you enter your logon details in. It is a mod that I really like. I would just liekt o be able to deploy it through a GPO. Thanks again for your input
  25. Hi I am having trouble creating a custom ADM template file that will add some text to the logon prompt in winXP. So far I have in my ADM file (mysetting.adm) CLASS MACHINE CATEGORY !!category CATEGORY !!categoryname POLICY !!policyname KEYNAME "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" EXPLAIN !!explaintext PART !!labeltextlp EDITTEXT DEFAULT "By logging on you agree to company policy" VALUENAME "LogonPrompt" END PART END POLICY END CATEGORY END CATEGORY [strings] category="merle Custom Policy Settings" categoryname="WinLogon Banner" policyname="LogonPrompt" explaintext="Add Logon text to the win logon." labeltextlp="LogonPrompt" What I am trying to do here is currently achieved via a vbs logon script as shown below. Although this works I would like to get it in to the AD so things are nice and tidy. On Error Resume Next Const SUCCESS = 0 Const LogERROR = 1 Const WARNING = 2 Const INFORMATION = 4 Const AUDIT_SUCCESS = 8 Const AUDIT_FAILURE = 16 Dim Path Set WSHShell = Wscript.CreateObject("WScript.Shell") Path= "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\" WSHShell.RegWrite path & "LogonPrompt","Stop! This system processes electronic mail classified as Private under the Electronics Communications and Privacy act of 1986. Law enforcement officers please take note that special warrants may be required to access this system.","REG_SZ" If err then msgbox "Error Encountered" WshShell.LogEvent LogERROR, "Logon Prompt Setup Failed" Else msgbox "Logon Prompt Setup Sucessful" WshShell.LogEvent INFORMATION, _ "Logon Prompt Setup Was Successful." End if
×
×
  • Create New...