halbaradkenafin
Members-
Posts
1,219 -
Joined
-
Last visited
Content Type
Forums
News
20th
EduGeek EDIT Conference
Blogs
Everything posted by halbaradkenafin
-
Same, I'll be juggling WoW, WoT and apparently a job and probably eating and stuff. Not sure how important those later ones are though.
-
I was roaming low sec one day in a Daredevil and jumped into a system, hit scan and saw a miner in a belt. Decided to rush over there and try to take him out. After a few shots he was in about 1/2 armour and Concord killed me as I'd jumped into a 0.6 without realising. Learning Skills were a pain but you saw a huge difference when you had 5/4, the refunded SP went into something similar for me. I think I'm going to resub tonight and give it a go for a few hours this week. Thanks guys for enabling my old habit, I've already been told by my gf if I get too addicted again then she's holding an intervention and cutting off my internet access.
-
Rushing to BC was "fine" since level 3 missions were very easy but then you'd want to get really good support skills before taking that next step to BS, especially which how difficult some of the level 4s are when you don't have full T2 tank and enough dps to kill the NPC BSs quickly. I remember doing level 4s in a mega tanked Drake and barely dropping below 50% shields even with full room aggro but it took so long to kill everything (and I suspect even longer now following the balance changes).
-
It's actually getting tempting to do so for me, mostly for the new ships I can train for and buy. Then again Tanks is nice for the log in -> shoot other people -> rage log out, all in 5 mins or less.
-
PowerShell copy folder to home dir of users in a text file
halbaradkenafin replied to randle's topic in Scripts
The method I mentioned above works fine for the $OpenFileDialog. For the Folder one I've done a bit of testing with it in the ISE and it looks like the button click is returned to the console (or at least as a general output), which means you can do something like this: $SomeVariable = $FolderBrowser.ShowDialog() This will mean that $FolderBrowser.SelectedPath is set to the value you want (assuming they click Ok) and then $SomeVariable is set to either "Ok" or "Cancel", which you can then run an If statement on. -
PowerShell copy folder to home dir of users in a text file
halbaradkenafin replied to randle's topic in Scripts
The reason it's opening a second dialog box is that you are calling the ShowDialog method in the If statement, which is causing it to open it again and then check the results. There are two solutions to this, one is to remove the first ShowDialog method call (which is being piped to Out-Null) and the other solution is to change the If statement to: if ($FolderBrowser.FileName -eq "") or if ($OpenFileDialog.FileName -eq "") This means that the first call to ShowDialog will set the value of the FileName property and you are then checking that value. It's more readable that way and would be my preferred solution, since at some point either myself or someone else would have to go back and update the script (or reread what it does) and readability is pretty useful then. The way I've done this in the past is to have a function which checks if a user exists in AD and then return either their AD object or 0 if they don't exist. I use that method as I'm usually passing the function the first name and surname of the pupil and usually year group to help narrow down the search for the user. I should probably update the Get-ADUser filter to actually use -Searchbase to specify OU rather than -Filter but I don't think it has much impact on performance and I doubt there is much difference for "best practice" purposes. Function Check-ADUser{ [string]$Forename = $args[0] [string]$Surname = $args[1] [string]$YearGroup = $args[2] if ($OU -contains "20") { $SecGroup = "CN=$OU,OU=$OU,OU=Students,OU=Users,DC=domain,DC=local" } ElseIf ($OU -contains "Teaching") { $SecGroup = "CN=All Staff,OU=Teaching Staff,OU=Users,DC=Domain,DC=local" } $ADUser = Get-ADUser -Filter {GivenName -eq $Forename -and Surname -eq $Surname -and MemberOf -eq $SecGroup} if ($ADUser) { return $ADUser } else { return 0 } } -
Impero vs NetSupport
halbaradkenafin replied to cannonballcoops1987's topic in Network and Classroom Management
You can block a site for as long as you want, either for specific users or for specific classrooms. You can disable the internet for classes or users and it persists till you unblock it again or set an expiration time. You can also block applications based on the Window title (we've got one set up to block Microphone Properties on all laptops as the kids like to turn up the boost and volume and cause nice feedback loops). The number of things it can do keeps surprising me. -
Impero vs NetSupport
halbaradkenafin replied to cannonballcoops1987's topic in Network and Classroom Management
Another vote for Impero. So many things you can do with it that it's well worth the cost. -
making a printer as default for computers via gpo
halbaradkenafin replied to dibekem's topic in Windows Server 2008 R2
That should be possible in the computer settings as well. If you've got groups for the computers then it's the same process. -
PowerShell copy folder to home dir of users in a text file
halbaradkenafin replied to randle's topic in Scripts
It basically means that it's reading the value you've put in path as $($User.HomeDirectory) and then everything after that as a separate parameter. You need to wrap the whole path in " " marks to show it's a string and it will parse that all together and should work correctly. -
PowerShell copy folder to home dir of users in a text file
halbaradkenafin replied to randle's topic in Scripts
The problem is that it's seeing the $User.HomeDirectory as a string and then everything after that as something extra. You'll need to do something like "$($User.HomeDirectory)\$(($FolderName.Split('\'))[-1])" as the path instead, it's a little ugly but should work. The other option would be to create a variable like $UserPath and set it to $User.HomeDirectory + "\" + ($FolderName.Split('\'))[-1] which should also work. -
PowerShell copy folder to home dir of users in a text file
halbaradkenafin replied to randle's topic in Scripts
The problem you've got here is that $FolderName contains the full original path to the folder rather than just the name of the folder. The easiest way to get just the information you want would be to use: ($FolderName.split("\"))[-1] This will take the $FolderName variable, put it in a temporary array based on where \ characters are and then take the last item in that array (which should be the folder you want) and return it as a string. Your Remove-Item command would then look like this: Remove-Item -Path $User.HomeDirectory\($FolderName.split("\"))[-1] -Force -Recurse If the folder is a few levels deeper than that (but always in the same place then just concatenate the path together like the other strings and you should be good to go. -
Powershell to convert files from one location to another
halbaradkenafin replied to penfold's topic in Scripts
In which case you just want something like: Move-Item -Path "Top level folder" -Destination "Top level destination" -Confirm:$False If you want them to be in both places then Copy-Item does that job and would need the -Recurse option adding. Both accept an -Include option but I'm not sure how that will work with a folder structure as I've never tested it. -
Powershell to convert files from one location to another
halbaradkenafin replied to penfold's topic in Scripts
You should just be able to add on something like this to the end of your current script: Get-ChildItem -Path $Folderpath -Include "xlsx" -Recurse | Foreach { Move-Item -Path $_.FullName -Destination "\\path\to\destination" -Force -Confirm:$False} -
PowerShell copy folder to home dir of users in a text file
halbaradkenafin replied to randle's topic in Scripts
Fun thing with using $_.HomeDrive in strings is that it parses $_ as the variable but assumes the rest is a string as normal. So the solution is to use $($_.Homedrive) and it will evaluate the value inside the brackets as a variable first and then push it to the string. -
Assuming you've got the phone number in a variable then something like this should get you started: If ($phone -match "+44") { $phone.replace("+44","0") } I'd double check how to use replace, posting from phone and can't test myself. Should only replace instances of +44 with 0.
-
PowerShell blank line between commands on console output
halbaradkenafin replied to randle's topic in Scripts
Just tested this and it works on my rdp machine running powershell 3. Write-Host" `n RM Service Host Service restarted on $Computername" -
PowerShell copy folder to home dir of users in a text file
halbaradkenafin replied to randle's topic in Scripts
Posting from tapatalk at the moment but this should give you a rough idea of what to do: Get-content $UserFile | Foreach { $User = Get-ADUser $_ - Properties homedirectory Copy-item -path $Foldername -destination $user.homedirectory -force -recurse } -
PowerShell blank line between commands on console output
halbaradkenafin replied to randle's topic in Scripts
Can you post the code you've got? -
I've used them in the past for IWB installs and they were pretty good at that. I'd probably look at ICT Direct or Very for new PCs though.
-
PowerShell blank line between commands on console output
halbaradkenafin replied to randle's topic in Scripts
If it's a script you've created yourself and are using Write-Host or Write-Output to put messages on the console then adding `n (backtick then n) to the end of each string which you're outputting should do it, if not then you can just put `n`n and that should work. -
Looks pretty cool but I'm not sure I like the "big" gap in the middle where it folds, I'm too used to standard qwerty keyboards that even those slightly curved ergonomic ones throw me off. Only device I'd really consider using this with would by my Surface Pro 2 but I've already got a Type keyboard with that which seems to be pretty much the same but not foldable (at least in half), I don't think I'd use it with my phone but I can see the interest in doing that.
-
I've seen that method used for two reasons; because parents/pupils are forgetful about letters etc and because it's considerably less paperwork/record keeping on the school's side. If it's for a third party site/publication/whatever then I'd go with Elsiegee40 that it should be done so that the parents give consent rather than assuming it but for most internal things either way works.
-
I've got a script for this and it should do everything you need. We set the password to something generic chosen when we are sorting out the csv (usually something like "Welcome1") and force the new accounts to change password at login. I've also got a function built in to check if the username already exists and if so to increment it and check again, this saves a bit of manual work checking each users potential username but if you use something sufficiently unique then you should be fine to just ignore that. It also exports all the created account details to a csv for us to pass out to teachers in case a user does end up with j.smith7 or something as their username. param( [Parameter(Mandatory=$true)][string]$Path = $(Read-Host "Enter the path to the csv") ) Function Check-ADUser{ [string]$Name = $args[0] $ADUser = Get-ADUser -Filter {SamAccountName -eq $Name} if ($ADUser) { return $ADUser.SamAccountName } else { return 0 } } $Users = Import-Csv -Path $Path Write-Output "Forename, Surname, Username, Password" >> "NewUsersCreated.csv" $Users | ForEach-Object { $ShortName = $Forename.Substring(0,1) + "." + $Surname $IsADUser = Check-ADUser $ShortName $Count = 1 while ($IsUser -ne 0) { $ShortName = $Forename.Substring(0,1) + "." + $Surname + "$Count" $IsADUser = Check-ADUser $ShortName $Count += 1 } $DisplayName = $_.forename + " " + $_.surname $SecureString = ConvertTo-SecureString $_.Password -AsPlainText -Force $HomeDirectory = "\\server\path\" + $_.intakeyear + "\" + $ShortName $ProfilePath = "\\server\path\" + $_.intakeyear + "\" + $ShortName $UserPrincipalName = $ShortName + "@domain.tld" $email = $ShortName + "@domain.tld" New-ADUser -Name $ShortName -Description $_.description -DisplayName $DisplayName -GivenName $_.forename -HomeDirectory $HomeDirectory -HomeDrive "N:" -ProfilePath $ProfilePath -SamAccountName $ShortName -Surname $_.surname -UserPrincipalName $UserPrincipalName -Path $_.OU -AccountPassword $SecureString -EmailAddress $email -Enabled 1 -CannotChangePassword 1 -PasswordNeverExpires 1 Start-Sleep -s 10 Add-ADGroupMember $_.intakeyear -Member $ShortName Write-Output "$Forename, $Surname, $ShortName, " + $_.password >> "NewYearUsersCreated.csv" } I tried to keep the variable names sensible for the purpose they were used but if you've got any questions then let me know. If you don't like a huge block of code then you can pretty much just do it in a single line if the columns of the csv are named correctly and a slightly longer line if they aren't.
