Jump to content

fawkers

Members
  • Posts

    196
  • Joined

  • Last visited

Everything posted by fawkers

  1. HI This might be just the thing your looking for Dsmod user if you've got a csv file with there username, forename and surname this bit of powershell from our script here might help you out function get-dn ([string]$SAMName,[string]$type) { $root = [ADSI]'' $searcher = new-object System.DirectoryServices.DirectorySearcher($root) if($type.Contains("group")){ $searcher.filter = "(&(objectClass=group)(cn= $SAMName))" } else{ $searcher.filter = "(&(objectClass=user)(sAMAccountName= $SAMName))" } $user = $searcher.findall() if ($user.count -gt 1){ $count = 0 foreach($i in $user){ write-host $count ": " $i.path $count = $count + 1 } $selection = Read-Host "Please select item: " return $user[$selection].path.toString() } else{ return $user[0].path } } Import-Csv c:\somefile.csv | ForEach-Object{ $userDN = get-dn $_.username dsmod user $UserDN.substring(7) -fn $_.Forename -ln $_.Surname -display ($_.Forename + " " + $_.Surname) } Hope this Helps .Adam
  2. Hello Folks I've got a pair of old Epson EMP-S1 projectors which have the dimmest image in the world dispite having a new bulb put in them. Can anyone point me in the direction of someone who could take a look at them for me, or give my any ideas why they are doing this. Thanks .Adam
  3. Hi Alan I've never tired that before, but looking at the wizard if you were to set the protection to be long term only, I dont see why it would create a storage pool. Hope this helps .Adam
  4. Hello Everyone Got this from technet New-ListView -Width 350 -Height 350 -DataBinding @{ ItemsSource = New-Binding -IsAsync -UpdateSourceTrigger PropertyChanged -Path Output } -View { New-GridView -AllowsColumnReorder -Columns { New-GridViewColumn "Name" New-GridViewColumn "PrinterStatus" } } -DataContext { Get-PowerShellDataSource -Script { $list = @() $PrinterStatus="Other","Unknown","Idle","Printing","Warming Up","Stopped Printing","Offiline" Get-WmiObject -Class Win32_Printer | ForEach-Object { $list += New-Object Object | Add-Member NoteProperty Name $_.name -passthru | Add-member NoteProperty PrinterStatus $PrinterStatus[$_.PrinterStatus-1] -passthru } foreach ($item in $list) { $item } } } -On_Loaded { Register-PowerShellCommand -Run -In "0:0:15" -ScriptBlock { $window.Content.DataContext.Script = $window.Content.DataContext.Script } } -asjob which works however if you cange the -script block to Get-PowerShellDataSource -Script { $list = @() $PrinterStatus="Other","Unknown","Idle","Printing","Warming Up","Stopped Printing","Offiline" $password = (Read-Host -AsSecureString) $user = New-Object Management.Automation.PSCredential ("olympus\ap.admin", $password) Get-WmiObject -Class Win32_Printer -computername "shsg-d02-prt01" -Credential $User | ForEach-Object { $list += New-Object Object | Add-Member NoteProperty Name $_.name -passthru | Add-member NoteProperty PrinterStatus $PrinterStatus[$_.PrinterStatus-1] -passthru } foreach ($item in $list) { $item } } to allow for a remote computer it doesn't work any more... if anyone has any ideas... Thanks .Adam
  5. HI there Were using outlook 2007 with an in house exchange server, however it might be worth talking to your ISP since there providing you with OWA they may be able to let you have outlook anywhere access. .Adam
  6. hi I found the following website How To: Load Balancing & Failover With Dual/ Multi WAN / ADSL / Cable Connections on Linux which if your looking for a cheap (free) soultion might we worth a look. .Adam
  7. Hi there There is a fronter user group on here which you might like to join found this in their posts http://www.edugeek.net/forums/groups/fronter-vle-users/126-how-have-nice-background-image-your-fronter-pages/ Hope this helps .Adam
  8. Hi Everyone Just quick update to my previous post here's a 3 line solution in Powershell #Where to put the files once moved $Target = "u:\test" $path = read-host "Please Enter Source Path: " Get-ChildItem $path -Include *friends*.txt -Recurse | Move-Item -Destination $target Just edit the -include to an expression of your choice. .Adam
  9. I'm no good with vbs but here is a copy of a powershell script i have which does the same sort of thing #Where to put the files once moved $Target = "u:\test" $Path = read-host "Please Enter Source Path: " $files = Get-ChildItem $path foreach($f in $files){ # in this case check for the letter a in the files name and a .txt ext. if($f.FullName.Contains("a") -and $f.FullName.Contains(".txt") ){ Move-Item $F.PSPath $target } }
  10. Hi There I've been trying to get this powershell script to work it should produce a windows with a list of printers, It's using the powershell plus kit from the MSDN site (also in the win 7 resource kit). $DetectedErrorState="unknown","other","No Error","Low Paper","No Paper",` "Low Toner","No Toner","Door OPen","Jammed","Offline","Service Requested",` "output Bin Full" $PrinterStatus="Other","Unknown","Idle","Printing","Warming Up","Stopped Printing","Offiline" #function test{ # $class = "win32_printer" # $printers = Get-WmiObject -Class $Class -ComputerName "" -Credential \ # foreach($p in $printers){ # output $p.Name, $DetectedErrorState[$p.DetectedErrorState], $PrinterStatus[$p.PrinterStatus] # } #} New-ListView -Width 350 -Height 350 -DataBinding @{ ItemsSource = New-Binding -IsAsync -UpdateSourceTrigger PropertyChanged -Path Output } -View { New-GridView -AllowsColumnReorder -Columns { New-GridViewColumn "Name" } } -DataContext { Get-PowerShellDataSource -Script { #Get-Process | ForEach-Object { $_ ; Start-Sleep -Milliseconds 25 } Get-WmiObject -Class $Class -ComputerName "\ |` ForEach-Object { $_.Name } } } -On_Loaded { Register-PowerShellCommand -Run -In "0:0:15" -ScriptBlock { $window.Content.DataContext.Script = $window.Content.DataContext.Script } } -asjob If you look in the -DataContext section the commented out line will work, but the four lines below it don't. Can anyone see whats going wrong? Thanks .Adam
  11. Hi Steve In fronter if you click on the down arrow next to a document on of the options is Edit File, it will ask you to download a bunch of active X stuff then every time you edit a file in this way it will download it for you,open it and when you then close it, it will ask what you want to do with the files (rename, replace, new virsion) and automaticly upload back to fronter. Hope this helps .Adam
  12. Heres the script with a bit of modification to create the groups automaticly if they dont already exist. Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin Add-pssnapin Quest.ActiveRoles.ADManagement Function decideEmail([string]$homeEmail,[string]$workEmail) { #Check for email, home email wins if($homeEmail -ne '') { return $homeEmail }#end if if($workEmail -ne '') { return $workEmail }#end if else{return $null} }#end function decideEmail function get-dn ([string]$SAMName,[string]$type) { $root = [ADSI]'' $searcher = new-object System.DirectoryServices.DirectorySearcher($root) switch($type) { contact{ $searcher.filter = "(&(objectClass=contact)(cn=$SAMName))" } group{ $searcher.filter = "(&(objectClass=group)(cn=$SAMName))" } user{ $searcher.filter = "(&(objectClass=user)(sAMAccountName=$SAMName))" } computer{ $searcher.filter = "(&(objectClass=computer)(name=$SAMName))" } } $user = $searcher.findall() if ($user.count -gt 1){ $count = 0 foreach($i in $user){ write-host $count ": " $i.path $count = $count + 1 } $selection = Read-Host "Please select item: " return $user[$selection].path.toString() } else{ return $user[0].path } } function CheckandCreateGroup([string]$GroupName) { $check = get-dn $groupName group if($check -eq $null) { new-qadgroup -ParentContainer 'OU=Creation,DC=DOMAIN,DC=local' -name $GroupName -samAccountName $GroupName -grouptype 'Distribution' -groupscope 'Universal' sleep 10 enable-DistributionGroup -Identity (get-dn $GroupName group).substring(7) -Alias ($groupname.replace(" ","")) -DisplayName $GroupName } }#end fuction creategroups Function AssignSecurityGroups([string]$fullName,[string]$yearGroup,[string]$RegGroup) { . CheckandCreateGroup("Parents") $yearGroup = "Parents "+$yearGroup CheckandCreateGroup($yearGroup) $RegGroup = "Parents "+$RegGroup CheckandCreateGroup($RegGroup) $ParentsGroupDN = get-dn "Parents" group $YeargroupDN = get-dn $yearGroup group $regGroupDN = get-dn $regGroup group $contactDN = get-dn $fullName contact add-QADGroupMember -identity $ParentsGroupDN.substring(7) -member $contactDN.substring(7) Add-QADGroupMember -identity $YearGroupDN.substring(7) -member $contactDN.substring(7) Add-QADGroupMember -identity $regGroupDN.substring(7) -member $contactDN.substring(7) } Function runImport([string]$filePath) { #Import CSV and iterate though Import-CSV $filePath | foreach-object{ #Create year and reg Group vars. Can only be done on first run if($_.Name -ne '') { $Script:reg = $_.reg $Script:year = $_.Year } #Check that the contact has Parental Responsibility if($_.'Parental Responsibility' -eq 'T') { $email = decideEmail $_.'home email' $_.'work email'; #If contact has an e-amil address create contact card if($email -ne $null) { #check if already existing contact $check = get-dn $_.'full Name' contact if($check -eq $null) { New-MailContact -Name $_.'Full Name' -ExternalEmailAddress $email -DisplayName $_.'Full Name' -FirstName $_.forename -LastName $_.surname -OrganizationalUnit 'ou=Creation,dc=DOMAIN,dc=local' -PrimarySmtpAddress $email } else { Set-MailContact -identity $_.'Full Name' -ExternalEmailAddress $email -DisplayName $_.'Full Name' -PrimarySmtpAddress $email } AssignSecurityGroups $_.'full Name' $Year $Reg; if($check -eq $null){sleep 10} Set-MailContact -Identity $_.'Full Name' -HiddenFromAddressListsEnabled:$True } } #end if } #end for } #end function runImport #Run Import runImport 's:\temp\contacts.csv';
  13. yes they do, once you've created the groups you can just re-run the script.
  14. Ok, what are the names of your distribution groups?
  15. We had a few incedents like this, the darlings were pushing (punching) the blaking plate into the machine fishing it out and going for the RAM. We put a bit of wood In-between the the blanking plate and the frame, after a couple of attempts they didn't do it again!
  16. no problem, The Quest stuff is free and avaible from PowerShell Commands (CMDLETs) for Active Directory by Quest Software Please do let us know if you add anything to the script, I'm always looking for ways to improve it.
  17. I had a more up to date one, this one uses the same sims report but we have distribution groups pre-created for Parents, Parents Year x , Parents REGGROUP and automaticly poplulates them. Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin Add-pssnapin Quest.ActiveRoles.ADManagement Function decideEmail([string]$homeEmail,[string]$workEmail) { #Check for email, home email wins if($homeEmail -ne '') { return $homeEmail }#end if if($workEmail -ne '') { return $workEmail }#end if else{return $null} }#end function decideEmail function get-dn ([string]$SAMName,[string]$type) { $root = [ADSI]'' $searcher = new-object System.DirectoryServices.DirectorySearcher($root) switch($type) { contact{ $searcher.filter = "(&(objectClass=contact)(cn=$SAMName))" } group{ $searcher.filter = "(&(objectClass=group)(cn=$SAMName))" } user{ $searcher.filter = "(&(objectClass=user)(sAMAccountName=$SAMName))" } computer{ $searcher.filter = "(&(objectClass=computer)(name=$SAMName))" } } $user = $searcher.findall() if ($user.count -gt 1){ $count = 0 foreach($i in $user){ write-host $count ": " $i.path $count = $count + 1 } $selection = Read-Host "Please select item: " return $user[$selection].path.toString() } else{ return $user[0].path } } Function AssignSecurityGroups([string]$fullName,[string]$yearGroup,[string]$RegGroup) { $yearGroup = "Parents "+$yearGroup $RegGroup = "Parents "+$RegGroup $ParentsGroupDN = get-dn "Parents" group $YeargroupDN = get-dn $yearGroup group $regGroupDN = get-dn $regGroup group $contactDN = get-dn $fullName contact add-QADGroupMember -identity $ParentsGroupDN.substring(7) -member $contactDN.substring(7) Add-QADGroupMember -identity $YearGroupDN.substring(7) -member $contactDN.substring(7) Add-QADGroupMember -identity $regGroupDN.substring(7) -member $contactDN.substring(7) } Function runImport([string]$filePath) { #Import CSV and iterate though Import-CSV $filePath | foreach-object{ #Create year and reg Group vars. Can only be done on first run if($_.Name -ne '') { $Script:reg = $_.reg $Script:year = $_.Year } #Check that the contact has Parental Responsibility if($_.'Parental Responsibility' -eq 'T') { $email = decideEmail $_.'home email' $_.'work email'; #If contact has an e-amil address create contact card if($email -ne $null) { #check if already existing contact $check = get-dn $_.'full Name' contact if($check -eq $null) { New-MailContact -Name $_.'Full Name' -ExternalEmailAddress $email -DisplayName $_.'Full Name' -FirstName $_.forename -LastName $_.surname -OrganizationalUnit 'ou=Creation,dc=DOMAIN,dc=local' -PrimarySmtpAddress $email } else { Set-MailContact -identity $_.'Full Name' -ExternalEmailAddress $email -DisplayName $_.'Full Name' -PrimarySmtpAddress $email } AssignSecurityGroups $_.'full Name' $Year $Reg; if($check -eq $null){sleep 10} Set-MailContact -Identity $_.'Full Name' -HiddenFromAddressListsEnabled:$True } } #end if } #end for } #end function runImport #Run Import runImport 's:\temp\contacts.csv';
  18. Hello I've recently done this using a sims export and a powershell script. The sims report was run against current students getting the following information: Year, Reg, Name, Full Name, Home Email, Work Email, Parental Responsibility Forname, Surname and outputting it to a CSV. I've then run the CSV with this powershell script Add-PSSnapin Microsoft.Exchange.Management.Powershell.Admin Function decideEmail([string]$homeEmail,[string]$workEmail) { #Check for email, home email wins if($homeEmail -ne '') { return $homeEmail }#end if else {return $workEmail}#end else }#end function decideEmail Function runImport([string]$filePath) { #Import CSV and iterate though Import-CSV $filePath | foreach-object{ #Check that Relationship is Mother or Farther if($_.Correspondence -eq 'T') { $email = decideEmail $_.'home email' $_.'work email'; New-MailContact -Name '$_.Full Name' -ExternalEmailAddress $email -DisplayName $_.'Full Name' -FirstName $_.forename -LastName $_.surname -OrganizationalUnit 'ou=test,ou=Creation,dc=DOMAIN,dc=local' -PrimarySmtpAddress $email -whatif } #end if } #end for } #end function runImport #Run Import runImport 's:\temp\forms\XXXX.csv'; Hope this helps, oh and dont for get to take the safty off before you run it (-whatif)
  19. Hi fokes We have a normal staff user account, a .admin account which has delegated permissions for the jobs that we do (local admin on workstations, servers and delegated permissions to ad, gpmc etc). Only the network manager has an admin account with domain admin privileges.
  20. Hello Everyone I'm trying to set up a new ISA server its enterprise edition since were going to have a pair of them spreading the work around. I'm currently setting up the first box, Installed Server 2003 ent. (two nic's one internal one external), Installed ISA 2006 and SP1 and patched to the latest updates. Then I've created a web chaining rule to our upstream LA Proxy. Tried to go to google it works, searched for somthing random it works, trie to go to live.com 400 Error, hotmail.com 400 Error, tried windows update goes to the site but wont run! Anyone got any ideas whats going on?
  21. Hello fokes, We use smart here and never had a problem with them, we do have a 600i in a 'meeting room' which means that it was a complete wast of money since the kids are never in there One of the odd things that our school does is to have an inset day where staff get to go and see how things are done in other schools. One of our science guys came back going on about a Wiimote Interactive Whiteboard, aparently the school he visited has done some clever stuff with a Wii contoler, bluetooth adaptor and some home made software. I'll let you know when I find out some more information.
  22. Hello I've been looking at this product as we badly need a new helpdesk and we plan on implementing FITS at the same time. I've taken a look at the becta website here and there are some odd things that are mssing from the recomended Incident/request sheet most notable the Equipments ID. Are there plans for this software to include these fields or has this just been left for the custom fields? Also would it be posable to have custom fields which can only be written to by a tech/admin? Thanks in advance. .Adam
  23. Hello my school in there wisdom are going for the IT mark all very well and good but i've just found out that some external people called egton are comming in to give us a hand with it. Has anyone ever heard of them or had dealings with them? Thanks .Adam
  24. I'm working on a script to automaticly add a personal signature to each outgoing message from exchange 2007. So with a transport rule you can add a 'Disclamer' on the bottom of a message with conditions on who its applied to. I've got 150 users so would like to script it but im running into problems any help with the below would be helpful. \\a list of names of all mail boxs $names = get-mailbox | format-list -property name $Condition = Get-TransportRulePredicate From \\This failes saying name is read only $Condition.name= \\some name from above list $Action = Get-TransportRuleAction ApplyDisclaimer $Action.Text = "Sample disclaimer text" New-TransportRule -Name "Sample disclaimer" -Condition @($Condition) -Action @($Action) Thanks
×
×
  • Create New...