Navigation

    ML
    • Register
    • Login
    • Search
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    1. Home
    2. Tags
    3. powershell
    Log in to post

    • How to use Azure Resource Graph with PowerShell
      Starwind • powershell azure microsoft azure • • Oksana  

      1
      1
      Votes
      1
      Posts
      53
      Views

      No one has replied

    • How to Use PowerShell Tasks in Azure DevOps Pipelines
      Starwind • powershell azure devops • • Oksana  

      1
      1
      Votes
      1
      Posts
      25
      Views

      No one has replied

    • Powershell for Snapshot Management
      IT Discussion • powershell esxi vsphere • • Grey  

      3
      4
      Votes
      3
      Posts
      70
      Views

      @DustinB3403 Tags added
    • Powershell to unhide all files and copy to nextcloud folder
      IT Discussion • powershell nextcloud bobcat • • JaredBusch  

      17
      0
      Votes
      17
      Posts
      96
      Views

      @WrCombs said in Powershell to unhide all files and copy to nextcloud folder: @Grey said in Powershell to unhide all files and copy to nextcloud folder: @JaredBusch said in Powershell to unhide all files and copy to nextcloud folder: @Grey said in Powershell to unhide all files and copy to nextcloud folder: @JaredBusch But why robocopy? Because it does at least skip the ones with no changes. Why get convoluted with Powershell to do the same? Not every system may have Robocopy. it became part of theOS with Windows Vista. So anything running Windows Vista or Higher will have robocopy as a part of the Operating system (as everyone should be using higher than vista at this point.. I mean.. windows 7 is obsolete now.. sooo..) Windows 10 1709 is obsolete too, so really anything not with a support mechanism shouldn't be used. But @JaredBusch might be getting paid stupid amounts of money to support Windows XP / Server 2000
    • YouTube Months in Review: September, October, and November 2020
      Self Promotion • linux youtube powershell scripting interview career advice • • EddieJennings  

      1
      0
      Votes
      1
      Posts
      52
      Views

      No one has replied

    • Powershell variable help
      IT Discussion • powershell scripting • • DustinB3403  

      23
      0
      Votes
      23
      Posts
      93
      Views

      P

      @DustinB3403 said in Powershell variable help: @Pete-S That is going to be complete subjective based on the type of spam that might come in. I follow what you're saying but I'm kind of stuck between having something functional or not (due to this). Well, you need to decide what you are allowing and not. For instance you have already decided to just use the subject line and not any of the other parts of the email, for instance author. You need to run the string through regex or something like that to remove characters you are not allowing. It might take more than one string operation to sanitize. I think you can escape any special character you want to allow with backtick `. Another option would be to allow the user to enter the entire KQL query themselves. Also if you get an error when trying to apply the search you put out an error "Invalid search input!" and go back to prompt the user for input again. That would be one way so solve problems.
    • Cleaning Your Azure Subscription Policies
      Starwind • powershell azure • • Oksana  

      1
      1
      Votes
      1
      Posts
      32
      Views

      No one has replied

    • How to Manage and Automate Your vSphere with PowerShell
      Starwind • vmware powershell vsphere • • Oksana  

      1
      1
      Votes
      1
      Posts
      34
      Views

      No one has replied

    • StarWind Free Webinar: Manage Your vSphere with PowerShell
      News • powershell vsphere • • Oksana  

      1
      1
      Votes
      1
      Posts
      37
      Views

      No one has replied

    • Download Exchange Online Email in PST Format
      IT Discussion • powershell office 365 email exchange o365 outlook exchange online pst • • scottalanmiller  

      7
      0
      Votes
      7
      Posts
      754
      Views

      Looks like @Osvaldo was able to get it.
    • Powershell/VMWARE Snapshot Cleanup
      IT Discussion • vmware powershell snapshots • • dafyre  

      1
      3
      Votes
      1
      Posts
      53
      Views

      No one has replied

    • YouTube Months in Review: July and August 2020
      Self Promotion • linux youtube powershell rhcsa music performance saxophone • • EddieJennings  

      3
      2
      Votes
      3
      Posts
      56
      Views

      @travisdh1 said in YouTube Months in Review: July and August 2020: @EddieJennings You've been busy! That I have. I didn't do a practice session for every objective because I ran out of time before the test. But taking the time to talk through most of them was a good way for me to determine if I needed to go back and review details.
    • Use PowerShell to Disable UAC on Windows 10
      IT Discussion • windows windows 10 powershell uac • • scottalanmiller  

      16
      3
      Votes
      16
      Posts
      370
      Views

      @EddieJennings said in Use PowerShell to Disable UAC on Windows 10: @Obsolesce said in Use PowerShell to Disable UAC on Windows 10: What special case needs UAC completely off? I'm curious about this as well. Installing malware
    • YouTube Month in Review: June 2020
      Self Promotion • linux youtube powershell music performance rhcsa • • EddieJennings  

      3
      0
      Votes
      3
      Posts
      85
      Views

      @jmoore said in YouTube Month in Review: June 2020: @EddieJennings Good info thanks eddie! You're welcome. My RHCSA videos are truly "practice sessions" for me, but the information should be accurate.
    • RBAC, Now Directly from Azure Portal
      Starwind • powershell azure rbac • • Oksana  

      1
      1
      Votes
      1
      Posts
      48
      Views

      No one has replied

    • Controlling Folder Depth when Exporting Folder ACL to Excel via Powershell
      IT Discussion • powershell active directory acl • • wirestyle22  

      2
      1
      Votes
      2
      Posts
      83
      Views

      Try this instead: $FolderPath = Get-ChildItem -Recurse -Depth 2 -Path "P:\Public" -Force Where -Depth is the how many levels deep you want to go. If you want to see what a cmdlet can do, you can use: Get-Help Get-ChildItem -Full
    • How to Start Azure VMs Automatically
      Starwind • powershell azure • • Oksana  

      1
      1
      Votes
      1
      Posts
      35
      Views

      No one has replied

    • YouTube Months in Review: February and March 2020
      Self Promotion • linux youtube powershell training self promo music education • • EddieJennings  

      2
      0
      Votes
      2
      Posts
      50
      Views

      @EddieJennings said in YouTube Months in Review: February and March 2020: 100 Subscribers!
    • UNSOLVED Need a Powershell script to move these files
      IT Discussion • powershell scripting • • JaredBusch  

      10
      1
      Votes
      10
      Posts
      227
      Views

      Going to work on this, finally, after dinner tonight. Thanks for those that posted.
    • PowerShell - Using Variables to Delete SMTP Proxy Addresses in AD
      IT Discussion • windows powershell active directory ad get-aduser • • wrx7m  

      11
      1
      Votes
      11
      Posts
      852
      Views

      @flaxking said in PowerShell - Using Variables to Delete SMTP Proxy Addresses in AD: if they do not have previous experience with objects Describes me. lol
    • Powershell - SFTP Upload Using Posh-SSH
      IT Discussion • powershell sftp posh-ssh • • wrx7m  

      9
      2
      Votes
      9
      Posts
      1300
      Views

      There's also a lot more that can be done, especially with the credentials... storing them as an encrypted file and retrieving them for the function (function just for that, functions using other functions), keeping all the parameter data in an object to retrieve, or from CSV, etc.... It depends on how far down the rabbit hole you want to go, and how much time you want to spend making it. Honestly, I'd do this kind of thing with a different project, but this can work too. There's a lot you can do.
    • YouTube Month in Review: January 2020
      Self Promotion • youtube powershell dns music music performance • • EddieJennings  

      1
      0
      Votes
      1
      Posts
      59
      Views

      No one has replied

    • How did you learn?
      Water Closet • powershell scripting noob • • WrCombs  

      15
      0
      Votes
      15
      Posts
      124
      Views

      @WrCombs said in How did you learn?: How did you learn Power-shell scripting? any books worth looking at? Looking at expanding some more, and I know Automation makes jobs way easier. This (https://channel9.msdn.com/Series/GetStartedPowerShell3/01) combined with doing tasks in PowerShell. In my opinion, as others have states, it's easier to learn via doing tasks. Added bonus is you complete a task with PowerShell or script it, then see if / how you can improve your script.
    • YouTube Month in Review: November 2019
      Self Promotion • youtube powershell self promo coppa teaching • • EddieJennings  

      1
      0
      Votes
      1
      Posts
      81
      Views

      No one has replied

    • Remove-Item cannot remove crap in Documents folder
      IT Discussion • windows 10 powershell nextcloud folder redirect • • JaredBusch  

      15
      0
      Votes
      15
      Posts
      420
      Views

      @Dashrender said in Remove-Item cannot remove crap in Documents folder: @Obsolesce said in Remove-Item cannot remove crap in Documents folder: @Dashrender said in Remove-Item cannot remove crap in Documents folder: @Obsolesce said in Remove-Item cannot remove crap in Documents folder: @JaredBusch I had a little bit of fun... whether useful to you or not. You can run this script as a regular user that has permissions to create and run scheduled tasks and create a file in specified directory. This will create a powershell script, and a scheduled tasks to run the script as the SYSTEM account. Then it will delete the script and the scheduled task. I could test most of it, but not some of it for obvious reasons. <#---- CHANGE THESE VARS: ----#> # Users to exclude from profile manipulation script, separated by pipe: $excludedKnownUsers = "Administrator|SpecialUser1" # New Script: $newLocalScriptPath = "$ENV:SystemDrive\scripts" $newLocalScriptFile = "testScript.ps1" # SID ending: (likely 21 if domain users) $sidEnd = 21 # Scheduled Task Name: $TaskName = "_Test Task 1" # Scheduled Task Description: $Description = "This is a test scheduled task that runs as the SYSTEM account and will be ran and then deleted at the end of this script." <#-------- END CHANGE --------#> # New Script: $newLocalScript = "$newLocalScriptPath\$newLocalScriptFile" # Gethers list of user profile paths: $userPaths = Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\*" -ErrorAction SilentlyContinue | Where-Object {($_.PSChildName -split '-')[3] -eq $sidEnd -and ($_.ProfileImagePath -split "\\")[2] -notmatch $excludedKnownUsers} # Creates a 'script in memory': $testScript = $null foreach ($userPath in $userPaths.ProfileImagePath) { $testScript += "Remove-Item -Path "$userPath\Documents" -Force -Recurse`n" $testScript += "New-Item -ItemType Junction -Path $userPath -Name 'Documents' -Target '$userPath\Nextcloud\Documents' -Force`n" } # Create a PowerShell script and save it as specified in vars: if (-not(Test-Path $newLocalScript)) {New-Item -Force $newLocalScript} $testScript | Out-File $newLocalScript -NoNewline -Force # Task Action: $Action = New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-ExecutionPolicy Bypass -File $newLocalScript" # Task Trigger: (task will be manually run immediately and then deleted, so keep 1 year out) $Trigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddYears(1) # Task Compatibility: $Compatibility = "Win8" # 'Win8' is 'Windows 10' in the GUI # Task Settings: $Settings = New-ScheduledTaskSettingsSet -Compatibility $Compatibility -StartWhenAvailable -AllowStartIfOnBatteries # Run task as local SYSTEM account with highest privileges: $Principal = New-ScheduledTaskPrincipal -UserId 'S-1-5-18' -RunLevel Highest # Create the scheduled task: Register-ScheduledTask -TaskName $TaskName -Description $Description -Action $Action -Trigger $Trigger -Settings $Settings -Principal $Principal -Force <#--------------------------#> # Run the scheduled task: Get-ScheduledTask -TaskName $TaskName | Start-ScheduledTask # Remove the created script: Remove-Item $newLocalScript -Force # Delete the scheduled task: Get-ScheduledTask -TaskName $TaskName | Unregister-ScheduledTask -Confirm:$false This seems like a HUGE security problem - normal users can schedule a task to run as SYSTEM? Then any virus could do the same thing. So what am I missing? I assume regular user would need elevated privileges at least... But I didn't test as a non-local admin, which is different than elevated privileges. But either way, that script can be automated and run as a user in the local admin group too with successful results. I think your script affects every user on the machine - assuming that's Ok for the envivronment - yep, have the local admin run it - and done. Yeah I designed it like that on purpose, because if users are using the device, whether it's one or 10 (unlikely), IMO they should all be redirected. But that can be changed no problem. But at least if it's one main person using it, it'll hit that one. If others do, they can be excluded. But you can always get the current signed on user and use that as in JB's original script, or in an automated way using other means I could add in if needed.
    • Microsoft Call Queues Monitoring with PowerShell UD
      Starwind • microsoft powershell microsoft teams • • Oksana  

      1
      1
      Votes
      1
      Posts
      160
      Views

      No one has replied

    • Windows 10 Updates - Trigger "Update and Restart"
      IT Discussion • windows windows 10 powershell cli windows update windows 10 upgrade • • wrx7m  

      11
      3
      Votes
      11
      Posts
      1643
      Views

      @wrx7m said in Windows 10 Updates - Trigger "Update and Restart": @IRJ said in Windows 10 Updates - Trigger "Update and Restart": @wrx7m said in Windows 10 Updates - Trigger "Update and Restart": @IRJ said in Windows 10 Updates - Trigger "Update and Restart": @wrx7m said in Windows 10 Updates - Trigger "Update and Restart": A simple restart command doesn't perform the update step, just the restart, so the update doesn't get applied. This has been an issue for a very long time with windows. I am surprised it hasn't been fixed yet. It's really annoying Well, at least with Win 7, a standard reboot applies updates. At least, I think it does. The main difference between Win 7 and 10, is that they have switched to the osoclient.exe to manage the updates. I'm pretty sure server 2008 and onward had the issue. I don't remember dealing with it on workstations I still have a 2008 R2 box and can test it on the next go 'round. I won't have it much longer, as I am dumping it prior to EOS. LOL - Didn't make this cutoff. Next week, hopefully.
    • Automate and back up your VMs through and through! With Azure Runbook
      Starwind • powershell azure • • Oksana  

      1
      1
      Votes
      1
      Posts
      80
      Views

      No one has replied

    • Powershell - The path is not of a legal form
      IT Discussion • powershell errors • • DustinB3403  

      9
      0
      Votes
      9
      Posts
      763
      Views

      I think I may have found a quicker/more clean means of doing this with just Get-ChildItem -Path "Drive-Letter" -Recurse -Force It prints everything out to the console or to a file for review, than you just have to read it.
    • Powershell suppress specific error message and not others
      IT Discussion • windows powershell smb administration unprintable file editing • • DustinB3403  

      4
      1
      Votes
      4
      Posts
      168
      Views

      P

      Why not filter out the files that you don't need to rename? Summat like: (Get-ChildItem -Path "path\to\folder" -Recurse | Where-Object {$_.Name -contains '•'} | Rename-Item -NewName {$_.Name -replace '•',''} -verbose -ErrorAction SilentlyContinue -ErrorVariable daError)