Churchers
Members-
Posts
19 -
Joined
-
Last visited
Reputation
0 NeutralAbout Churchers

Personal Information
-
Occupation
IT Support
-
Location
Hampshire
-
this is a script i wrote for out printers. our PC's are SDTRRRNN (RRR is room and NN is pc number) our printers are SPTRRRNN (RRR is room and NN is printer number) this VBS script at user login, looks for printers in the same room as the machine and sets them as default. It then has a manual override for them strange non standard sections. might not be any help to anyone but here it is. ' TICKET 11609 ' Created By X - 17/05/2013 '################################# BlacklistArray = Array("CutePDF Writer","Adobe PDF","Microsoft XPS Document Writer","SagePDFPrinter","WebEx Document Loader","Fax","Microsoft Print to PDF","Send To OneNote 16") 'On Error Resume Next '################################# '###### DO NOT EDIT START ##### '################################# 'GET LOCAL COMPUTER NAME Set wshNetwork = WScript.CreateObject( "WScript.Network" ) strCompCode = ucase(left(wshNetwork.ComputerName,1)) & ucase(right(left(wshNetwork.ComputerName,6),3)) IF ucase(left(wshNetwork.ComputerName,3))="SDT" OR ucase(left(wshNetwork.ComputerName,3))="STB" OR ucase(left(wshNetwork.ComputerName,3))="JDT" OR ucase(left(wshNetwork.ComputerName,3))="JTB" THEN WScript.Sleep(20000) 'CHECK FOR PRINTERS WITH SAME NAME AS PC ON THE NETWORK Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer") For Each objPrinter in colPrinters IF not objPrinter.Attributes And 64 Then 'NETWORK ON LOCAL PrinterArray = split(objPrinter.Name,"\") PrinterName1 = ucase(PrinterArray(3)) PrinterCode1 = ucase(left(PrinterName1,1)) & ucase(right(left(PrinterName1,6),3)) IF PrinterCode1 = strCompCode THEN WshNetwork.SetDefaultPrinter objPrinter.Name TestingEcho1 = TestingEcho1 & strCompCode1 & " PRINTERCODE=(" & PrinterCode1 & ") - (" & ucase(PrinterArray(2)) & "\" & PrinterName1 & ") " & vbCrLf IF PrinterCode1 = strCompCode THEN TestingEcho1B = TestingEcho1B & objPrinter.Name & vbCrLf End IF Next 'CHECK FOR LOCAL PRINTERS, SKIP ANY LISTED Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer") For Each objPrinter in colPrinters BlacklistDevice = 0 IF objPrinter.Attributes And 64 Then 'LOCAL PRINTERS ON LOCAL For each x in BlacklistArray IF x = objPrinter.Name Then BlacklistDevice = 1 Next IF BlacklistDevice = 0 then WshNetwork.SetDefaultPrinter objPrinter.Name ELSE EchoSkipped = " - ( Blacklisted in script )" End IF TestingEcho2 = TestingEcho2 & "PRINTER NAME=(" & objPrinter.Name & ")" & EchoSkipped & vbCrLf EchoSkipped = NULL End IF Next ELSE DebugMSGFail = "##################################" & vbCrLf & "FAIL: Automatic selection not enabled for this PC name" & vbCrLf & "##################################" & vbCrLf & vbCrLf 'WScript.quit End IF 'WScript.Sleep(10000) '################################# '###### DO NOT EDIT FINISH ##### '################################# 'MANUAL MAPPINGS '###################################################################################################################### IF wshNetwork.ComputerName = "SDT253080000" THEN WshNetwork.SetDefaultPrinter "\\theia\SPT254015350" 'Temp PE '###################################################################################################################### '//################################# '//################################# '//####### DEBUG SECTION ####### '//################################# '//################################# Set WshShell = CreateObject("WScript.Shell") defaultprn = WshShell.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device") arrPrnStr = Split(defaultprn,",") fullPrinterString = arrPrnStr(0) arrFullPrnStr = Split(fullPrinterString,"\") shortPrinterName= arrFullPrnStr(Ubound(arrFullPrnStr)) '//################ IF TestingEcho1B = "" then TestingEcho1B = "No network printers match" & vbCrLf & vbCrLf DebugMSG1 = "THIS PC CODE" & vbCrLf & "===============" & vbCrLf & "PCCODE=(" & strCompCode & ") - (" & wshNetwork.ComputerName & ")" & vbCrLf & vbCrLf & vbCrLf DebugMSG2 = "NETWORK PRINTERS" & vbCrLf & "===============" & vbCrLf & TestingEcho1 & vbCrLf & "Match list:" & vbCrLf & TestingEcho1B & vbCrLf & vbCrLf DebugMSG3 = "LOCAL PRINTERS" & vbCrLf & "===============" & vbCrLf & TestingEcho2 & vbCrLf & vbCrLf DebugMSG4 = "DEFAULT PRINTER" & vbCrLf & "==============================" & vbCrLf & "Your default printer is set to " & shortPrinterName '//################################# '//################################# '//################################# '/### ENABLE BELOW FOR REPORTS Wscript.Echo DebugMSGFail & DebugMSG1 & DebugMSG2 & DebugMSG3 & DebugMSG4 Wscript.Echo "Done"
-
I have devised a system in our school that works well on allowing staff to enable / disable exam accounts by time (booking) the attached script runs in a loop looking for new .exam files If someone want to use it, please let me know ! happy to help setup, but if no one wants it then i'm not writing it up for external use. Please also find attached ZIP with all files required $Str_ExamFileLocation="C:\ExamManager\Exams" #Specify exam file location. $Str_EmailServer="relay.domain.com" #Specify SMTP server $Str_EmailFrom="[email protected]" #Specify email address to send from $Str_Emailto="[email protected]" #Specify email address to send report to. Import-Module ActiveDirectory <#This Function completes all tasks#> function FuncCommands($action,$group,$email,$MoveOU){ $FuncLoadedFile = Get-Content "$($Str_ExamFileLocation)\$($Str_Currentfile + $action + $group).exam" #Get content from file. foreach ($FuncLoadedline in $FuncLoadedFile) #Loop per line of content collected. { IF ($MoveOU -ne "") {Get-ADUser $FuncLoadedline | Move-ADObject -TargetPath $MoveOU} #IF Function '$MoveOU' has a value, complete the command to move OU,else leave in current OU. IF ($action -eq "D") {Disable-ADAccount -Identity $FuncLoadedline} #IF Function '$action' is D then disable account(s). IF ($action -eq "E") {Enable-ADAccount -Identity $FuncLoadedline} #IF Function '$action' is E then Enable account(s). $Str_EmailList = $Str_EmailList + $FuncLoadedline + "`r`n" } IF ($email -eq "Y") { IF ($action -eq "D") { $Str_EmailSubject = IF($Group -eq "9") {"Normal Accounts Disabled"} ELSE {"Exam Accounts Disabled"} $Str_EmailBody = "The following accounts have been disabled." + "`r`n" + $Str_EmailList } ELSE { $Str_EmailSubject = IF($Group -eq "9") {"Normal Accounts Enabled"} ELSE {"Exam Accounts Enabled"} $Str_EmailBody = "The following accounts have been enabled." + "`r`n" + $Str_EmailList } Send-MailMessage -SMTPServer $Str_EmailServer -From $Str_EmailFrom -To $Str_Emailto -Subject $Str_EmailSubject -Body $Str_EmailBody } Rename-Item "$($Str_ExamFileLocation)\$($Str_Currentfile + $action + $group).exam" "COMPLETE-$($Str_Currentfile + $action + $group).exam" #Rename the file to show complete. } <#This loop gets the current date/time and looks for the file for processing#> while($true) { #Loop forever. CLS ECHO "Running" $Str_Currentfile = $(Get-Date -format "yyyyMMdd") + "_" + $(Get-Date -format "HHmm") #(Get date) + (add "_") + (Get Time) #$Str_Currentfile = "20160201_0600" #Override for testing ECHO "Looking for stamp $Str_Currentfile" #Disable List IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)D1.exam"){FuncCommands -action "D" -group "1" -email "Y" -MoveOU "OU=Controlled Assessment Accounts,OU=Controlled Assessment,OU=SS,OU=Pupils,OU=Users,OU=Churcher's,DC=domain,DC=local"} IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)D2.exam"){FuncCommands -action "D" -group "2" -email "Y" -MoveOU "OU=Controlled Assessment Accounts,OU=Controlled Assessment,OU=SS,OU=Pupils,OU=Users,OU=Churcher's,DC=domain,DC=local"} IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)D3.exam"){FuncCommands -action "D" -group "3" -email "Y" -MoveOU "OU=Controlled Assessment Accounts,OU=Controlled Assessment,OU=SS,OU=Pupils,OU=Users,OU=Churcher's,DC=domain,DC=local"} IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)D9.exam"){FuncCommands -action "D" -group "9" -email "Y" -MoveOU ""} #Enable List IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)E1.exam"){FuncCommands -action "E" -group "1" -email "Y" -MoveOU "OU=No Restrictions,OU=Controlled Assessment,OU=SS,OU=Pupils,OU=Users,OU=Churcher's,DC=domain,DC=local"} IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)E2.exam"){FuncCommands -action "E" -group "2" -email "Y" -MoveOU "OU=No Internet,OU=Controlled Assessment,OU=SS,OU=Pupils,OU=Users,OU=Churcher's,DC=domain,DC=local"} IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)E3.exam"){FuncCommands -action "E" -group "3" -email "Y" -MoveOU "OU=No Internet and No Office,OU=Controlled Assessment,OU=SS,OU=Pupils,OU=Users,OU=Churcher's,DC=domain,DC=local"} IF (Test-Path "$($Str_ExamFileLocation)\$($Str_Currentfile)E9.exam"){FuncCommands -action "E" -group "9" -email "Y" -MoveOU ""} ECHO "Waiting to check again..." ECHO "$Str_Currentfile" | Out-File $Str_ExamFileLocation\LastRun.log #Write log file to monitor script running. start-sleep -seconds 50 } ExamManager.zip
-
[ms office - 2010] From line empty in all emails when you open them
Churchers replied to localzuk's topic in Office Software
Checking in with same issue. -
Activinspire Flipchart Corruption
Churchers replied to Churchers's topic in Promethean Direct Support
The teacher has told me she has downgraded her OS back to Windows 8 and everything is now fine. All flipcharts she has created at home are now loading up in school. -
Activinspire Flipchart Corruption
Churchers replied to Churchers's topic in Promethean Direct Support
Hi phillyrovers I understand that this is a very difficult one to troubleshoot. I think the teacher is bring in the flipcharts using a USB key stick. I will get her to email them directly in from home. -
Wondering if anybody can help with this ? We have a teacher who is creating Activinspire Flipcharts at home, and when they are loaded onto Activinspire in school, the contents of each page are only displayed in the page browser Thumbnall preview. The actual flipchart page is blank. Both at home and school are running Activinspire 2.4.66096. The teachers home PC in Windows 10, school runs windows 7. Does anybody have any ideas what the cause is of this ?
-
Worked it out ! -name is the display name I wanted dsquery user -samid "%username%" | dsmod user -disabled yes
-
I have this working username = tomjones dsquery user -name "%username%" | dsmod user -disabled yes But if the username contains a . username = sue.smith dsquery user -name "%username%" | dsmod user -disabled yes I get the following error: dsmod failed:'Target object for this command' is missing. type dsmod /? for help.
-
I did this one. Had very good feed back.. and because your just starting you should read this. give you some good insight (and section on Something to think about!) FOG .29 & .32 My Windows 7 Guide (32/64 Bit) DocV1 | blog.ibuddy.info
-
drivers are on the base image. what do you do if you have something that needs to be install after deploy (an exe) but needs dos commands parameters to install?
-
Yeh but we can do more like what screen and make primary etc.., just some little features we needed
-
What features do you want to include? Where did you get the exe source? ...website?, I'll take a look. If you are adding features you should ask on the fog forum, others might have good idea's. (or feature request section.)
-
I will upload/make a public version available tomorrow.
-
Yeh, I agree up to that point. Our image then continues on and runs a script to add software that needs to be installed after sysprep, (example: AV agent). It also reboots twice making sure that all GPO software has been downloaded and installed. We also set screen settings, more than fog can provide. and anything else. then shuts down on completion of tasks.
-
We also use fog. We have devised a script to finish the install for us and shutdown the machines after a sysprep. how are others doing this?
