Jump to content

QwertyMash

Members
  • Posts

    149
  • Joined

  • Last visited

Everything posted by QwertyMash

  1. Spot on Yeah it needs more like haha it's just literally the core of what he asked for haha
  2. Oh don't get me wrong I literally said I threw it together. I figured they could maybe add what they needed check wise and I totally agree with you haha For instance it doesn't check for other people already having that UPN, when you sat writing Powershell on the mobile website it gets a little tedious haha Original poster, if you'd like help finishing off the script to be more robust as suggested by the above just message me and while I'm at the PC I'd happily help.
  3. Hello, Here is a quick script I just slapped together for you that would change all the users UPNs - to [email protected] - there is two variables at the top to change. It need ran as an administrator and on a device wither with RSAT installed or from a domain controller. I have done some very basic testing on my development domain and it worked but I recommend doing a few little tests of your own first. If you want any help or would like it to do more just fire me a message. Thank you, CaptainQwerty. # Script: UPN change # Author: CaptainQwerty # Date Created: 28/07/2019 #requires -module ActiveDirectory #requires -RunAsAdministrator # Change there two variables, the top one is your domain and the second one is the OU that contains the users $domain = "Example.co.uk" $ou = "OU=Staff,DC=Example,DC=co,DC=uk" write-host "Importing Acive Directory module" Import-Module ActiveDirectory # Getting all users from the OU $users = Get-ADUser -filter * -SearchBase $ou # For each user in the OU change their UPN foreach($user in $users){ # Generating the UPN $firstname = $user.GivenName $firstInitial = $firstname.substring(0,1) $upn = "$firstInitial.$($user.surname)@$domain" # Setting the users UPN set-aduser $user -UserPrincipalName $upn } edit: Fixed formatting
  4. I can write you a Powershell script if you like to do this for all the accounts. Are they in a particular OU? Thank you.
  5. I personally would only be turning on mission critical services, as in ones that 2 weeks of downtime would be too costly. If the gear could afford to be off the entire time I would leave it off.
  6. The logon type 3 is a network logon, so stuff like connecting to a shared folder on that machine from another device on the network or similar tasks. I believe WMI queries in some instances when done across a network can also result in a similar or the same log being made.
  7. This is where not having a proper domain is proving to be a nightmare. Is there absolutely no way you guys can get an old computer up and running as a domain controller? Your life would be far easier. So much more flexibility with Group Policy.
  8. Glad you got the original working. As I say, if no one manages to help you before I get home, I will look at the script tonight when I am not at work and make the adjustments you need.
  9. USB drives for back ups? I'd consider something a little less volatile myself like haha. I finish work at 4, I will look at this tonight for you if no one replies earlier with the solution for you. - - - Updated - - - I feel like what I said earlier as a modification should have worked at a quick glance at it so yes maybe something else is wrong
  10. Very correct like, a fully registry dump and slap will likely cause a lot of odd issues.
  11. So you want to copy the C:\iSCSIVirtualDisks folder? and only copy so many copies of it in the destination folder? I've forgotten what the end goal was haha.
  12. Yeah don't be doing that. That is an awful idea. WHAT OPERATING SYSTEM IS IT!!!!! haha
  13. What operating system are you on? What is the regkey when it is disabled and what is it when it is enabled? Will look at a script for you.
  14. So its a batch file. What operating system are you using? 7? 10? How is it being executed?
  15. Did you put a \ at the end of the source or not? Can you give us the latest version of the script? (I am at work so having to be sly haha)
  16. The users always log on as admin? What operating system you running? and how are you delivering the script?
  17. If the script is running under their credentials not as an administrator it won't work as they won't have access to modify the registry key. Is it being executed as a standard user or administrator?
  18. I actually wrote a program to write all my reports called b*llshit-it haha Very much a similar thing to this. It would write a pretty unique report for the student per class based off a few answers about their grades, attendance and attitude. Not once did I get pulled up on my reports haha. I will post a gif tonight when I get home. Your work looks good!
  19. I hope it does, PM me if you need any help with it.
  20. Glad it is working for you Yeah Mailflow can have some unexpected results when it comes to email threads ending up with a lot of signatures at the bottom of the email and stuff haha.
  21. Thank you, sorry about bad formatting, I replied on my phone.
  22. [color=#333333][i]#Requires -Version 3.0$Source = "C:\iSCSIVirtualDisks\man-vd.vhdx"$Destination = "E:"$TargetDir = "{0}{1}" -f $Destination, (Get-Date).ToString("yyyy-MM-dd HH.mm.ss")Get-ChildItem -Path $Destination -Directory | Where-Object { $_.Name -match "^\d{4}-\d{2}-\d{2} \d{2}\.\d{2}\.\d{2}$"} | Sort-Object LastWriteTime -Descending | Remove-Item -Force -RecurseIf (-not(Test-Path "$TargetDir")) { $Null = New-Item "$TargetDir" -Type Directory; Copy-Item -Path "$Source" -Destination "$TargetDir" -ErrorAction Stop -Verbose }[/i][/color] Can try this. Obviously in a test environment first.
  23. At a very quick glance you need to change the Select-Object -Skip 2 - If you are only wanting the latest I don't think you even need to do the skip. But if you play around trying that on 1 or removing that section you should get sorted.
×
×
  • Create New...