Jump to content

reggiep

Members
  • Posts

    1,570
  • Joined

  • Last visited

Everything posted by reggiep

  1. I think I have it now! My group policy for execution of powershell was set up was for the computer. I needed to set one up for user.
  2. It's frustrating because originally I had a half working batch file which would have been the easiest solution. I have group policy set to allow powershell but it still seems to fail when running. I'm not at my usual PC at the moment so I'll report back shortly!
  3. I have this rather fabulous script which launches a page for users which is different depending on their ip address... function getipthirdoctet { ipconfig | where-object {$_ –match “IPv4 Address”} | foreach-object{$_.Split(“.")[-2]} } $ipaddress = getipthirdoctet if ($ipaddress.length -eq 1) { $ipaddress ='0'+$ipaddress } C:\Progra~1\Intern~1\iexplore.exe -k "http://intranet/?i=$ipaddress" However I am having serious problems with powershell security so i am seeing if any edugeekers can suggest an alternative to powershell that might do the same thing. Can anyone help?
  4. Self signing looks like a lot of work!
  5. So I have this now thanks... - - - Updated - - - And now my remote computers will not run unsigned powershell scripts so i may have to do this with vbs instead!
  6. Not silly at all. I really rushed through this to get it onto a system quickly but then now have time to give it a bit more thought!
  7. I have created this script but I'm not convinced that this is the shortest way to do the if statement, can anyone suggest how this could be shortened? function getipthirdoctet { ipconfig | where-object {$_ –match “IPv4 Address”} | foreach-object{$_.Split(“.")[-2]} } $ipaddress = getipthirdoctet if ($ipaddress -eq 1) { $ipaddress =01 } Elseif ($ipaddress -eq 2) { $ipaddress =02 } Elseif ($ipaddress -eq 3) { $ipaddress =03 } Elseif ($ipaddress -eq 4) { $ipaddress =04 } Elseif ($ipaddress -eq 5) { $ipaddress =05 } Elseif ($ipaddress -eq 6) { $ipaddress =06 } Elseif ($ipaddress -eq 7) { $ipaddress =07 } Elseif ($ipaddress -eq 8) { $ipaddress =08 } Elseif ($ipaddress -eq 9) { $ipaddress =09 } Thanks
  8. Wow thanks, I only put that on as an afterthought. My fault for reading the error too literally. Thanks
  9. Hi, I have a script that I run to remove rogue Hotfixes when SCCM will not remove them quickly or has issues... function Uninstall-Hotfix { [cmdletbinding()] param( $computername = $env:computername, [string] $HotfixID ) $hotfixes = Get-WmiObject -ComputerName $computername -Class Win32_QuickFixEngineering | select hotfixid echo $computername echo $HotfixID if($hotfixes -match $hotfixID) { $hotfixID = $HotfixID.Replace("KB","") Write-host "Found the hotfix KB" + $HotfixID Write-Host "Uninstalling the hotfix" $UninstallString = "cmd.exe /c wusa.exe /uninstall /KB:$hotfixID /quiet /norestart" ([WMICLASS]"\\$computername\ROOT\CIMV2:win32_process").Create($UninstallString) | out-null Start-Sleep 6 Write-Host "Waiting for update removal to finish ..." write-host "Completed the uninstallation of $hotfixID" } else { write-host "Given hotfix($hotfixID) not found" return } } # Remove hash below to run on certain asset and remove certain kb Uninstall-HotFix -ComputerName TeacherPC -HotfixID KB3008923 I am trying to run this against a list of computers from a text file, so I found this one as an example that gets bios info... $a = Get-Content "H:\Scripts\Powershell\Run command from text list\MachinesWithHotfix.txt" foreach ($i in $a) {$i + "`n" + "=========================="; Get-WMIObject Win32_BIOS -computername $i} So I tried to cram these two together to get the hotfix removal to run against a list like this... function Uninstall-Hotfix { [cmdletbinding()] param( $computername = $env:computername, [string] $HotfixID ) $hotfixes = Get-WmiObject -ComputerName $computername -Class Win32_QuickFixEngineering | select hotfixid echo $computername echo $HotfixID if($hotfixes -match $hotfixID) { $hotfixID = $HotfixID.Replace("KB","") Write-host "Found the hotfix KB" + $HotfixID Write-Host "Uninstalling the hotfix" $UninstallString = "cmd.exe /c wusa.exe /uninstall /KB:$hotfixID /quiet /norestart" ([WMICLASS]"\\$computername\ROOT\CIMV2:win32_process").Create($UninstallString) | out-null Start-Sleep 6 Write-Host "Waiting for update removal to finish ..." write-host "Completed the uninstallation of $hotfixID" } else { write-host "Given hotfix($hotfixID) not found" return } } $a = Get-Content "H:\Scripts\Powershell\Run command from text list\MachinesWithHotfix.txt" foreach ($i in $a) {$i + "`n" + "=========================="; Uninstall-HotFix -ComputerName $i -HotfixID KB3008923 > H:\Scripts\Powershell\Run command from text list\HotfixRemoved.txt } But this gives me an error ... Am I going about this the wrong way? Can anyone suggest another way to carry out this task? Thanks
  10. Cheers for that, but as it's not going to be paid for by work, it's not going to be paid for at all!
  11. Hi, I'm trying to get a better grip on powershell and I can find loads of script archives but would love to try to understand what is going on. Can anyone suggest any books or websites that could walk me through powershell as a novice? Thanks
  12. I've forced the printer to use one tray. We'll see how that goes. Thanks
  13. I have not seen this actually happen but some users are complaining that the HP LaserJet Pro 400 M401dn that they are using is missing off wither the first or last page on large print runs, around about 100 pages. Has anyone else had something similar? Could it maybe be a memory issue with the job being so large? Thanks
  14. I didn't even consider using the ethernet sockets. I'm doing a review of rooms now!
  15. FIXED!! I am currently trying to install classroombooking onto a 1and1 server as our linux box is starting to creak. I have set up the dbase and moved all files across but when I browse to the index.php i get 404 Page Not Found The page you requested was not found. Which is different from their 404 if the folder or file does not exist. I gave full 777 permision to it and then the whole foldr (just for testing) but still have the same result. Do you have any suggestions? FIXED!!! I was putting localhost as hostname but it needed to be the one provided by 1and1 in the mysql section.
  16. No, that was just a worst case scenario cost!
  17. Ah yes but does it have 7 CCTV cameras installed?
  18. I get it as £51.51 for all seven cameras!! Watts /1000 x hours x cost per pence 4.2 / 1000 x 8760 x 20p = £7.36 x 7 = £51.51
  19. Axis M32 series camera Power over Ethernet IEEE 802.3af Class 2 (max. 4.2 W) seven of them three Poe switches that have a maximum power of 256 watts that have a netear green sticker on them, for what it's worth! Can sopmebody show me the formula that you use for this, for my future development!!
  20. We are a PFI school and recently had our CCTV upgraded. Duribng the install wer had 7 new AXIS IP cameras installed, running back to three Netgear POE switches. The PFI company reckon that it will cost an additional £800 in electricity for these cameras. Now I have the task of trying to work out how much they will really cost to run. Not being an electrician or mathematical of mind I have no idea how to work this out. i have the Watts that the cameras use and the maximum for the switches but I don't know how to relate this to cost? Anyone out there have any ideas how to do this? Thanks
  21. Hi All, I have been asked to put an apple tv in each classroom so that each staff member can project their iPad onto their whiteboard. That's no problem as I have done it to 9 classrooms already. My worry is that as they are wireless they may start causing issues as there will be so many of them. Has anyone else done this and if so did you have to carry out any extra work? Thanks
  22. The under pressure bit sounds all too familiar!
  23. Looking at step by step guides it does look like a scary big job! Would you agree?
  24. @pantscat Yes it is a physical server. Clustering is something I have never done before but am interested in looking at. @jinnantonnixx - Thanks I'll look into the log shipping too @zag - I explained to our business manager that if I recovered from last nights backups that we would lose the days changes and she wasn't happy. I wasn't sure what else we could do to be honest but looking at jinnantonnixx post I may have options now. I've just worked out jinnantonnixx name!
  25. We had a nasty fright yesterday when we rebooted our SQL server with our finance and sims on it! So I am in the middle of looking to replace it with something that has redundancy built in. Can anyone suggest who to talk to about this? Thanks
×
×
  • Create New...