Jump to content

pleach85

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by pleach85

  1. I'll go for 247. Fingers crossed!
  2. Hi, I've done a similar thing in my code before, I've not had time to test it but I think this will work. SELECT COUNT(ID) AS Amount, DATEADD(DAY, DATEDIFF(DAY, 0, EntryDate), 0) AS TransactionDates FROM Transactions GROUP BY DATEADD(DAY, DATEDIFF(DAY, 0, EntryDate), 0)
  3. I know you can use custom profiles with OpenShot, so it looks like it will do the job Profiles never used them though!
  4. Nope, all working fine for me from Chrome. Have you checked all the certificates in the certification path are correct
  5. No problem, glad we've got there in the end. If you can't follow any of it let me know and I'll try and explain. Peter
  6. No problem. Check the Users OU as you'll probably spot some of the accounts in there. The problem was we were using the display name as the "name" parameter in the new-aduser cmd. Therefore when you then tried to move the new user into the year7 OU it couldn't as there was already an object with that name in the ou, i.e the previous one we'd created. The solution (hopefully)... use the unique SAM as the Name field, I've also added the path field to the command as you can just create the user in the OU you want, you don't have to create the user and them move them. ForEach ($User in $Users) { $Displayname = $User.Firstname + "." + $User.Lastname $UserFirstname = $User.Firstname $Lastname = $User.Lastname $OU = $User.OU $Description = $User.Description $Password = $User.Password $Company = "schoolname" $SAM = $User.Firstname + "." + $User.Lastname # create SAM from first . last name $i = 1 # reset number to append variable $originalSAM = $SAM # keep the original SAM in a separate variable (easier to increment number) while((Get-ADUser -Filter {sAMAccountName -eq $SAM}) -ne $null){ # check if SAM exists $SAM = $originalSAM + $i.ToString() # If not add number to the end of original SAM $i++ # increment number } # repeat while SAM exists # Now we have a unique SAM set any variable dependant on it $Email = $SAM + "@test.com" $UPN = $SAM + "@test.com" New-ADUser -Name "$SAM" ` -DisplayName "$Displayname" ` -SamAccountName "$SAM" ` -UserPrincipalName "$UPN" ` -GivenName "$UserFirstname" ` -Surname "$Lastname" ` -Description "$Description" ` -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -ChangePasswordAtLogon $true -PasswordNeverExpires $false ` -Server test.com ` -Email "$Email" ` -Company "$Company" ` -homedrive "u:" -homedirectory \\servername\sharename\$SAM ` -path "OU=Year 7,OU=Student,OU=Users,OU=BurtonBorough,DC=test,DC= com" #-homedrive "u:" -homedirectory \\servername\sharename\%username% #Get-ADUser $SAM | Move-ADObject -TargetPath "OU=Year 7,OU=Student,OU=Users,OU=BurtonBorough,DC=test,DC= com" Add-ADPrincipalGroupMembership $SAM students Add-ADPrincipalGroupMembership $SAM "All Years" # Add-ADPrincipalGroupMembership $SAM - Duplicate this line to add the user into more AD groups new-item "c:\users\$SAM" -ItemType Directory #This line can be replaced with the line below to determine the full unc path of the folder $acl = Get-Acl -Path "c:\users\$SAM" $permission = $SAM, 'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow' $permission2 = 'students', 'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow' $permission3 = 'All Years', 'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow' $rule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permission $rule2 = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permission2 $rule3 = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permission3 $acl.AddAccessRule($rule) $acl.ADDAccessRule($rule2) $acl.ADDAccessRule($rule3) $acl | Set-Acl -Path "c:\users\$SAM" #new-item "\\servername\sharename\foldername" -ItemType Directory }
  7. I've modified your script as below but I can't see any reason why the first name is getting a number appended, I would not search in the where by surname as that does not guarantee a unique SAM/UPN which is what you need. I've moved every variable that is dependent on the SAM to after we find a unique SAM. This script does however assume that in your current directory all UPN and SAM are the same, I also noticed a bug so whereby I wasn't using the original SAM so I've fixed that and commented to hopefully make it clear. Can you post your CSV so I can have a look at that, can't think of any reason why jake.b/noel.m wouldn't be created by the script. ForEach ($User in $Users) { $Displayname = $User.Firstname + "." + $User.Lastname $UserFirstname = $User.Firstname $Lastname = $User.Lastname $OU = $User.OU $Description = $User.Description $Password = $User.Password $Company = "schoolname" $SAM = $User.Firstname + "." + $User.Lastname # create SAM from first . last name $i = 1 # reset number to append variable $originalSAM = $SAM # keep the original SAM in a separate variable (easier to increment number) while((Get-ADUser -Filter {sAMAccountName -eq $SAM}) -ne $null){ # check if SAM exists $SAM = $originalSAM + $i.ToString() # If not add number to the end of original SAM $i++ # increment number } # repeat while SAM exists # Now we have a unique SAM set any variable dependant on it $Email = $SAM + "@test.com" $UPN = $SAM + "@test.com" New-ADUser -Name "$Displayname" ` -DisplayName "$Displayname" ` -SamAccountName "$SAM" ` -UserPrincipalName "$UPN" ` -GivenName "$UserFirstname" ` -Surname "$Lastname" ` -Description "$Description" ` -AccountPassword (ConvertTo-SecureString $Password -AsPlainText -Force) -Enabled $true -ChangePasswordAtLogon $true -PasswordNeverExpires $false ` -Server test.com ` -Email "$Email" ` -Company "$Company" ` -homedrive "u:" -homedirectory \\servername\sharename\$SAM #-homedrive "u:" -homedirectory \\servername\sharename\%username% Get-ADUser $SAM | Move-ADObject -TargetPath "OU=Year 7,OU=Student,OU=Users,OU=BurtonBorough,DC=test,DC= com" Add-ADPrincipalGroupMembership $SAM students Add-ADPrincipalGroupMembership $SAM "All Years" # Add-ADPrincipalGroupMembership $SAM - Duplicate this line to add the user into more AD groups new-item "c:\users\$SAM" -ItemType Directory #This line can be replaced with the line below to determine the full unc path of the folder $acl = Get-Acl -Path "c:\users\$SAM" $permission = $SAM, 'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow' $permission2 = 'students', 'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow' $permission3 = 'All Years', 'FullControl', 'ContainerInherit, ObjectInherit', 'None', 'Allow' $rule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permission $rule2 = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permission2 $rule3 = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule -ArgumentList $permission3 $acl.AddAccessRule($rule) $acl.ADDAccessRule($rule2) $acl.ADDAccessRule($rule3) $acl | Set-Acl -Path "c:\users\$SAM" #new-item "\\servername\sharename\foldername" -ItemType Directory }
  8. I just looked at your script and you're currently setting the UPN to firstname.surname@... rather than the SAM@... so the above might need to be changed depending on your requirements. I also noticed you're using the UPN as the email... again this will need to be checked. Personally I would set $UPN = $SAM + "@test.com"
  9. Sorry, I see what I've missed you'll need to update the UPN value as well as the SAM value. If you use the same SAM name as the prefix for the UPN name this should do it $i = 1 while((Get-ADUser -Filter {sAMAccountName -eq $SAM}) -ne $null){ $SAM = $SAM + $i.ToString() $UPN = $SAM + '@' + ($UPN -split '@')[1] $i++ }
  10. $i = 1 while((Get-ADUser -Filter {sAMAccountName -eq $SAM}) -ne $null){ $SAM = $SAM + $i.ToString() $i++ } If you place this just after you set your variables from the csv and before the New-ADUser command it should do what you want. Then you don't need an if else with lots of duplicated code in it, much cleaner.
  11. You're overwriting the permission variable containing the SAM permissions with the student permissions before applying it to the folder. I think you will need to create two rules using different variables and add them to your acl using "AddAccessRule" rather than SetAccessRule.
  12. No problem glad it helped. I think that error is possibly down to the version of powershell you're running it works in version 5 but I'm not sure when they brought in .contains as an array method.
  13. I would do it like this... ### A list of child items in the directory $directory = Get-ChildItem "D:\" ### @edugeek: Not sure if this needs to be their logon name? ################# $username = "domain\username" ### The permissions to apply to this user $permissionsToApply = "ReadAndExecute" ### an array of the folders that need these permissions $foldersToBeGivenPermissions = @("TestFolder") #Make the access Rule $accessRule = New-Object system.security.accesscontrol.filesystemaccessrule($username, $permissionsToApply, "None", "None", "Allow") foreach ($folder in $directory) { #check if the foldername is in the array $foldersToBeGivenPermissions if($foldersToBeGivenPermissions.Contains($folder.name)) { #If it is set the permissions on the parent folder and then the actual folder SetPermissions $folder.Parent.FullName $accessRule SetPermissions $folder.FullName $accessRule } } #Reuseable function that takes a folder/file path and a new access rule and adds the rule to the folder function SetPermissions ($path,$ACLRule) { #get current permissions $folderACL = Get-Acl($path) #add new permission to this list $folderACL.AddAccessRule($ACLRule) #set the permissions on the folder Set-Acl $path $folderACL } I've commented it so hopefully you should be able to follow it through and see what it's doing.
  14. We copy our nightly backups to an encrypted RDX drive which we then place into a fire proof safe. As far as I am aware RDX drives only go up to 3TB at the moment so this might not be suitable although they do a multi drive system called an RDX QuikStation which might be worth looking into. Granted it's still a hard drive (at the 3TB size) but they're built to last.
  15. It's also not supported on exchange servers at the moment, just in case anyone with an in house exchange server is thinking of rolling it out. On .NET Framework 4.6.1 and Exchange compatibility - Exchange Team Blog - Site Home - TechNet Blogs
  16. Have you run something like wireshark on the affected computers to make sure they are actually receiving the WOL packet when sent from Impero?
  17. You have to be assigned the Mailbox Import Export management role to use the DeleteContent switch. See https://technet.microsoft.com/en-us/library/dd638205(v=exchg.160).aspx for details.
  18. I've found the dried stuff a bit hit and miss but I planted some from seed this year and they loved it!
  19. You just need to create one permission entry for your user/group of type Allow and then another separate entry of type Deny for the same user/group (I'm assuming you are using the advanced security settings)
  20. Just don't give them the following, Create Folders/Append Data Delete Subfolders and Files Delete Change permissions Take Ownership I think that will do it.
  21. I'm also a Windows Media Centre user, I've played with Kodi for live TV with tvheadend but the lack of straight forward series recording and just finding it a little buggy put me off. I'm thinking of trying it again though this time using Windows Media Centre as a backend, read good things about it although never tried it. Add-on:PVR.WMC - Kodi
  22. It sounds like you've covered everything in DNS and Exchange, so I can only assume there is a rule in IIS that is redirecting you to the oldDomain. A rule is often created to redirect the root (https://mail.domain) to https://mail.domain/owa, there are a few ways this can be done (error page redirect, URL Rewrite ....) so it looks like you're going to have to spend a little time trying to find out if there is anything like this in IIS.
  23. Yeah, I think I'm running a different version of syslinux to the one on UBCD so that's not helping either. I'm thinking loading the ISO is probably the simplest (although not the quickest) way to go.
  24. Actually, although that works for some of the programs in UBCD it's not working for them all.... I have another look!
  25. I seem to have got it working for me, not as straight forward as I first thought. I've written a what I did below let me know if you need any more detail Using the version of syslinux you downloaded (in my case version 6.02) copy the linux.c32 file from syslinux-6.02\bios\com32\modules\linux.c32 and paste it into the root of the wds boot folder for the architecture you are using (in my case D:\RemoteInstall\Boot\x64) Download the UBCD iso and mount/extract it. Copy the 'pmagic' and 'ubcd' folders into the same folder you copied linux.c32 too (in my case D:\RemoteInstall\Boot\x64). Edit your pxelinux.cfg/default to add the menu option #-boot to UBCD LABEL UBCD MENU LABEL UBCD COM32 menu.c32 APPEND ubcd/menus/syslinux/main.cfg Fingers crossed that'll sort it!
×
×
  • Create New...