Search the Community
Showing results for tags 'scripting'.
-
Hello. We've been having some trouble with a printer driver and wondered if there's anyone here who could write a script that would: 1- Stop the printer spool service 2- Remove a set of .dll files 3- Start the print spool service It must be simple to do this? It would need to be able to run at login using GPO and AD.
-
Hi there, I need to create a number of sub OU's in active directory underneath one existing OU. I've created the first (top-level) OU via CSVDE but I'm having trouble working out how to create the child OU's This is the CSV file I used to create the initial OU... DN,instanceType,distinguishedName,objectCategory,objectClass,ou,name "OU=department,DC=school,DC=local",4,"OU=department,DC=school,DC=local","CN=Organizational-Unit,CN=Schema,CN=Configuration,DC=school,DC=local",organizationalUnit,department,department So - underneath department I'd like to create a bunch of other OU's, I want to use CSVDE really. Anyone?? TIA
- 1 reply
-
- active directory
- csvde
-
(and 1 more)
Tagged with:
-
Does anyone know how to accomplish this : We have a windows server named server1 with many local groups. These groups need to be renamed. I want to use Excel or a textfile that has 2 columns ...the first column contains the current groupname and the second one contains the new name. Does anyone know a VBS/WMI script to accomplish this ? regards bio..
-
Is this possible? Shockingly in my LA we have 5,000 client PC's all imaged off a few image, that no one ever bothered to sysprep or newsid. In March we switch to AD and obviously this is a problem. Our able but anti AD / AD project leader says he's scripting the creation of new SIDs on all 5,000 PC's, and it doesn't sweem right to me, having run newsid and seen how it takes at least 3 minutes to execute, obviously needing elevated privileges.
-
Hello! I'm converting documents to PDF using a script I found - my knowledge of Powershell is very limited. I want to know how to make the script target multiple folders and then copy the converted PDF files into a folder WITHIN the one with the original word documents in and name it PDF or CONVERTED or something similar. Here's the script: $documents_path = 'c:\PDF-Convert\Science\' $word_app = New-Object -ComObject Word.Application # This filter will find .doc as well as .docx documents Get-ChildItem -Path $documents_path -Filter *.doc? | ForEach-Object { $document = $word_app.Documents.Open($_.FullName) $pdf_filename = "$($_.DirectoryName)\$($_.BaseName).pdf" $document.SaveAs([ref] $pdf_filename, [ref] 17) $document.Close() } $word_app.Quit()
- 6 replies
-
- converting
- copying
-
(and 3 more)
Tagged with:
-
Lets say we have D:\ with folders named: A B C D etc... (to Z) I want to CD into folder A THEN xcopy subfolder1 here, xcopy subfolder2 there, copy Folder A flat root content files somewhere else, THEN CD.. THEN Move to folder B The process will then start again, until all folders have been completed. I think i need to use a FOR /D Research = Batch for loops - Judago's scripts / console stuff for /d - Loop through directory | SS64.com Any help would be amazing !
-
Hi folks. Was hoping someone to help me out with a powershell script problem. I'm quite new to PS and been trying to put together a script that will check a remote machine for attached printers and mapped drives, then output this to a text file. I got the script to work at first, but then thought it would be nice to have it ping the machine and if no response let you know it's down. However, I've got stuck trying to put the ping function in. If anyone could shed any light on where I'm going wrong that would be great. Script looks like this so far: #Get computer name # cls Function GetCompName { $Compname =Read-Host "Please enter computer name" } # Ping status of computer # ForEach($MachineName In $CompName) {$PingStatus = Gwmi Win32_PingStatus -Filter "Address = 'CompName'" | Select-Object StatusCode If ($PingStatus.StatusCode -eq 0) {Function GetInfo} Else {Write-Host $MachineName Ping Failed -Fore "Red"}} #PC Printer Information Function GetInfo { $prin = gwmi -computer $compname Win32_Printer | Select-Object DeviceID,DriverName, PortName, Comment | Format-List #PC drive Information $drv = gwmi -Computer $compname -Class Win32_MappedLogicalDisk | select Name, ProviderName } Write-Output $prin, $drv | Out-File -FilePath c:\Results.txt Write-Host " " Write-Host " " [string]$message = "Results can be found in C:\Results.txt - Press any key to continue..." Write-Host -NoNewLine $Message $Host.UI.RawUI.FlushInputBuffer() do { $key = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown").Character } while ([int]$key -eq 0) Write-Host "" Thanks
-
I am trying to simplify pulling directory ACLs. We have thousands of them and so I'd like to adjust this script I have so that it asks me what directory I'd like to check the ACLs for. Where it stands now the script must be edited manually when you run it on each machine. You have to change the directory name. So I'd like to turn the directory name in a variable and put the variable in the folder path. I appreciate the help as it will save so much time for me. It exports it to a .csv file where I can then import it into Excel and sort the tables accordingly. Here is what I have: powershell C:\GetDirectoryACls\GetDirectoryACLs.ps1 Get-childitem D:\Inetpub -recurse | where{$_.psiscontainer} | Get-Acl | % { $path = $_.Path $_.Access | % { New-Object PSObject -Property @{ Folder = $path.Replace("Microsoft.PowerShell.Core\FileSystem::","") Access = $_.FileSystemRights Control = $_.AccessControlType User = $_.IdentityReference Inheritance = $_.IsInherited } } } | ? {-not $_.Inheritance} | export-csv C:\GetDirectoryACLs\Get_Directory_ACLs_Output.csv -force
-
Hi, We have awards for various occasions in assemblies, for example there was a tablet awarded to one randomly picked from a selection of students with 100% Attendance in each year. What we have done is for each student with 100% attendance, is create a PowerPoint with each students photo and name on a seperate slide and set it to auto advance with a delay of 0.01sec. When the PowerPoint is presented the slides quickly spin through. With the student photos scrolling the head will hit S to stop the PowerPoint at a random (winning) student. This looks pretty good but its a right pain having to create the PowerPoint each time. As we did it once before (and made it look so much better than it was previously done), it is now our task and is taking quite a bit of time to setup each slide/PowerPoint. Could I ask, does anyone do anything differently? Is there an available program or web script that randomly picks an image from a folder? Something like on "Ant and Dec's Saturday night takeaway" where the audience photos just cycles through and it slows to one winner would be ideal. I've google for all the Selector Tools, or Random generator flash programs I could find but they are pretty poor! Student Photos dumped into a web hosted folder and a script to rotate through slowing down to one photo would be the easiest and best solution I can think of. Thanks in advance.
-
Need to give an AD group execute permissions to a particular folder on the c drive of cover 550 computers and I want to automate this.
- 2 replies
-
- active directory (ad)
- permissions
-
(and 3 more)
Tagged with:
-
Can anyone help me with a papercut script for simplex/duplex print jobs? I would like the user to get a popup if they try to print in simplex asking them to confirm if they want to print in simplex or if they would like to convert to duplex. I tried modifying the convert to gray scale script that I found on here, although the popup appears properly the jobs do not seem to be getting converted to duplex. This is what I have so far: [color=#770088][font=monospace]function [/font][/color][color=black][font=monospace]printJobHook[/font][/color][color=#666666][font=monospace]([/font][/color][color=#0000FF][font=monospace]inputs[/font][/color][color=#666666][font=monospace], [/font][/color][color=#0000FF][font=monospace]actions[/font][/color][color=#666666][font=monospace]) [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#AA7700][font=monospace]// your code here[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]if [/font][/color][color=#666666][font=monospace]([/font][/color][color=#666666][font=monospace]![/font][/color][color=#004499][font=monospace]inputs[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]job[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]isAnalysisComplete[/font][/color][color=#666666][font=monospace]) [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#AA7700][font=monospace]// No job details yet so return.[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]return[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#666666][font=monospace]}[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#AA7700][font=monospace]// Test if the job is duplex (double-sided)[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]if [/font][/color][color=#666666][font=monospace]([/font][/color][color=#004499][font=monospace]inputs[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]job[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]isDuplex[/font][/color][color=#666666][font=monospace]) [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#AA7700][font=monospace]// Add your action code here[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]log[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]debug[/font][/color][color=#666666][font=monospace]([/font][/color][color=#AA2222][font=monospace]"The print job is double-sided"[/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#666666][font=monospace]}[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]else [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]var [/font][/color][color=#0000FF][font=monospace]CONVERT_MESSAGE [/font][/color][color=#666666][font=monospace]= [/font][/color][color=#AA2222][font=monospace]'You have printed this job in simplex. Would you like to convert your job to duplex? Selecting "No" will print the job in simplex, Selecting "YES" will change the job to duplex.'[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]if [/font][/color][color=#666666][font=monospace]([/font][/color][color=#004499][font=monospace]inputs[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]client[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]isRunning[/font][/color][color=#666666][font=monospace]) [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#AA7700][font=monospace]// User is running the client software. Ask if they want to convert to grayscale or cancel.[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]var [/font][/color][color=#0000FF][font=monospace]response [/font][/color][color=#666666][font=monospace]= [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]client[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]promptYesNo[/font][/color][color=#666666][font=monospace]([/font][/color][color=#004499][font=monospace]CONVERT_MESSAGE[/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color][color=#770088][font=monospace]if [/font][/color][color=#666666][font=monospace]([/font][/color][color=#004499][font=monospace]response [/font][/color][color=#666666][font=monospace]== [/font][/color][color=#AA2222][font=monospace]'YES'[/font][/color][color=#666666][font=monospace]) [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]log[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]debug[/font][/color][color=#666666][font=monospace]([/font][/color][color=#AA2222][font=monospace]'User chose to convert their job to duplex.'[/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]job[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]convertToDuplex[/font][/color][color=#666666][font=monospace]([/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color][color=#666666][font=monospace]} [/font][/color][color=#770088][font=monospace]else [/font][/color][color=#770088][font=monospace]if [/font][/color][color=#666666][font=monospace]([/font][/color][color=#004499][font=monospace]response [/font][/color][color=#666666][font=monospace]== [/font][/color][color=#AA2222][font=monospace]'TIMEOUT'[/font][/color][color=#666666][font=monospace]) [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]log[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]debug[/font][/color][color=#666666][font=monospace]([/font][/color][color=#AA2222][font=monospace]'Dialog timed out, canceling job.'[/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]job[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]cancel[/font][/color][color=#666666][font=monospace]([/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#666666][font=monospace]} [/font][/color][color=#770088][font=monospace]else [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]log[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]debug[/font][/color][color=#666666][font=monospace]([/font][/color][color=#AA2222][font=monospace]'User chose to keep on printing in simplex'[/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace] [/font][/color][color=#666666][font=monospace]}[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#666666][font=monospace]} [/font][/color][color=#770088][font=monospace]else [/font][/color][color=#666666][font=monospace]{[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]log[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]debug[/font][/color][color=#666666][font=monospace]([/font][/color][color=#AA2222][font=monospace]'Canceling job due to simplex pages and user not running client software.'[/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#004499][font=monospace]actions[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]job[/font][/color][color=#666666][font=monospace].[/font][/color][color=black][font=monospace]cancel[/font][/color][color=#666666][font=monospace]([/font][/color][color=#666666][font=monospace])[/font][/color][color=#666666][font=monospace];[/font][/color] [color=#666666][font=monospace] [/font][/color][color=#666666][font=monospace]}[/font][/color] [color=#666666][font=monospace] }[/font][/color] [color=#666666][font=monospace] [/font][/color] [color=#666666][font=monospace]}[/font][/color]
-
Hi I am having problems in running robocopy below is the script, the only problem is that its removes the simsbackup as-well as the delete folder? Please can someone help!!! mkdir c:\delete robocopy "C:\simsbackup" "C:\delete" /E /MOVE /MINAGE:2 /LOG+:c:\robocopy.log rmdir "c:\delete" /s /q Thanks
-
Hello, I'm looking for some advice with scripts when running Novell / Netware and DeepFreeze (by Faronics). DeepFreeze, for those that aren't familiar, is a program that resets the PC back to a default state whenever the PC is restarted. I'm attempting to script some updates and make changes to PC's in mass in our school district, but am running into some issues. The main one is how to, in mass, log several systems at once into our Novell Network (via a script or some other method). Most likely there is a way to do this with Novell management tools, but we lack any strong internal Novell support in our system. If I can do that, everything else should be simple. The full idea is: - log systems into Novell - have a script thaw the PC's (turn off DeepFreeze to allow changes) - restart the computers - log back into Novell, do any updates / changes - freeze the PC's (turn DeepFreeze back on) As you can see, the logging into Novell part is the problem, as our XP machines come up with the Novell login screen before actually booting into Windows. Any help would be appreciated. Thanks! Damian Bailey Technician Louisa County Public Schools, VA, USA
- 3 replies
-
- deepfreeze
- login issue
-
(and 2 more)
Tagged with:
-
I have a problem. I have wrote a script that gets an IP address from Nslookup and passes it to DelProf2.exe. However, I obviously need some error handling in the script so I can influence the flow of the batch file as it is run (if something goes wrong GOTO function name). I'd like to control the flow upon Nslookup succeeding or failing. How do I access the exit status and assign it to a variable? Thanks in advance. This is my first post. This has been doing my head in! Note: I will post up finished bat file upon completion so you can all benefit if needed.
- 7 replies
-
- batch
- batch file
-
(and 3 more)
Tagged with:
-
Hi, I was wondering if anyone has any good resources for learning scripting to deploy software on remote PCs? I was sat in a classroom on Friday installing 8 bits of software on multiple laptops knowing there are better ways to do it, just not knowing where to start. I would either want to do it by having the script read a file with computer names, or probably more simply, creating a script I can run on each computer to install the software. I am also unsure of how I get around install prompts. So if anyone knows of any good material I can read through to learn this sort of stuff? Thanks
- 8 replies
-
- auto install
- scripting
-
(and 1 more)
Tagged with:
-
We have a load of old computers in school (Year 1 and reception). Year 1 and reception have generic usernames and passwords which the teachers log onto the computers with in a morning. The old computers where getting really crappy and wouldnt run much on them so i created a script to remote them into an RDP server with high spec. Check it out (Note that i removed the computers from the domain first). When the computer boots up it will automatically boot into the RDP server. InternalRDP.zip Let me know what you all think?? If you want to know exactly what the script changes ask me
-
I need a hand here, my scripting skills are insufficent to pull this one off. However the end result is likely to benifit others in the future. But first, some background info. I have recently been creating a new file server running Ubuntu 8.04 on a HP DL140G3 with an external MSA60 Disk Array. Obviously to service the Windows clients this is running Samba (with all the ACL, quota, etc bells and whistles). The underlying file system for the user storage is RAID-5. This is then allocated with LVM2 into various partitions. These are formatted as JFS and mounted some place sensible (/home/samba/blah normally) and then shared via samba as required. I wish to use LVM based snapshots to provide 'shadow copies' to Windows clients. To do this I need a suite of scripts to do the following: 1) create LVM snapshots on a regular basis of some LVM paritions. New snapshots must be mounted in the way sambas shadow copy VFS module expects. 2) remount LVM snapshots cleanly in the case of a server reboot/crash/etc. 2) delete LVM snapshots after a predetermined time and/or when disk space is low. A couple of links with background info: Chapter 23. Stackable VFS modules Samba Shadow Copy Howto - Waikato Linux Users Group Samba and MS Shadow Copy
-
In SharePoint 2010, I have a need to create a document store with multiple folders within, then set permissions on each folder for individual users. Teacher will have Full control on the Document Library & all contents Student A will have Contribute to the Folder Student A Student B will have Contribute to the Folder Student B ...... and so on. The Folder Names & Usernames will come from an AD export into a csv file. I can seem to manage to create the folders from the csv file using Powershell when the Document Library is mapped to a drive. I would prefer to connect Powershell directly to the Document Library to create then set the permissions. Does anyone have a script that can do this that I could edit for my own needs as it's one of those things that if I can get right, will help lots of our teaching staff here. Scripting is not one of my strong points.
-
- powershell
- scripting
-
(and 1 more)
Tagged with:
-
Hello. I want to be able to automatically print new PDF's that are added to a folder. I'm using Watch 4 Folder to monitor the newly added files but I need a script to run so that when the file is added it prints and then moves the file to a 'completed' folder. Does anyone have the knowledge or experience of doing this?
- 1 reply
-
- automation
- batch files
-
(and 3 more)
Tagged with:
-
Hello All, I am absolutely new to this forum but feel like I have done due diligence and looked through for this particular issue. If you find something I missed my apologies.. So with that said... Looking to create a folder for each user with the following perms in place on each folder Username <-- All have list with domain admins as folder owner Public <-- All have read and write access on this folder Private <--only the user has access READ, WRITE, EDIT Dropbox <-- user has full access others can only write to this folder I would like to be able to script this but am open to software solutions as well. My previous solution of creating these folders with a good old perl script don't work any longer on server 2008 help!! I would even be fine with getting the basics of how to append to my initial script and be able to add the command to my broken perl script. On my pre Server 2008 boxes, could create and set up these shares but alas now it bombs out. mkdir E:\Faculty\username macfile directory /path:E:\Faculty\username /owner:"USAdmins" /group:username /permissions:11111111010 mkdir E:\Faculty\username\public macfile directory /path:E:\Faculty\username\public /owner:"USAdmins" /group:username /permissions:11111111010 mkdir E:\Faculty\username\private macfile directory /path:E:\Faculty\username\private /owner:"USAdmins" /group:username /permissions:11111100010 mkdir E:\Faculty\username\dropbox macfile directory /path:E:\Faculty\username\dropbox /owner:"USAdmins" /group:username /permissions:11111100110mkdir E:\Faculty\username macfile directory /path:E:\Faculty\username /owner:"USAdmins" /group:username /permissions:11111111010 mkdir E:\Faculty\username\public macfile directory /path:E:\Faculty\username\public /owner:"USAdmins" /group:username /permissions:11111111010 mkdir E:\Faculty\username\private macfile directory /path:E:\Faculty\username\private /owner:"USAdmins" /group:username /permissions:11111100010 mkdir E:\Faculty\username\dropbox macfile directory /path:E:\Faculty\username\dropbox /owner:"USAdmins" /group:username /permissions:11111100110 while macfile is no longer a usable or recognizable command for Windows 2008 with the support of AFP going away, I would appreciate the commands to set the permissions for the SMB share. We are now using ExtremeZ-IP and it wil handle the sharing portion for our MAC users. Thank you for your time!! Joe
-
Hi I want to copy only new files created on the day to be copied to another location is this possible? Thanks This gets the latest file but not all the files that were created! Dim fNewest set oFolder=createobject("scripting.filesystemobject").getfolder("\\dylan\d$\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup") For Each aFile In oFolder.Files If fNewest = "" Then Set fNewest = aFile Else If fNewest.DateCreated < aFile.DateCreated Then Set fNewest = aFile End If End If Next Msgbox fNewest.Name
