ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Topics
    2. Tags
    3. powershell
    Log in to post
    • All categories
    • OksanaO

      StarWind Free Webinar: Manage your Hyper-V environment hands-free with PowerShell task automation!

      Watching Ignoring Scheduled Pinned Locked Moved Starwind powershell hyper-v
      1
      1 Votes
      1 Posts
      245 Views
      No one has replied
    • wrx7mW

      Any Way to Automate Adding a New Computer to an AD Group?

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows 10 windows server ad active directory gpo mdt powershell ps pdq deploy ou task sequence
      32
      0 Votes
      32 Posts
      9k Views
      F

      @marcinozga said in Any Way to Automate Adding a New Computer to an AD Group?:

      @flaxking said in Any Way to Automate Adding a New Computer to an AD Group?:

      @marcinozga said in Any Way to Automate Adding a New Computer to an AD Group?:

      Ansible can do that. https://docs.ansible.com/ansible/latest/modules/win_domain_group_membership_module.html#win-domain-group-membership-module
      You can add new PCs to domain, and change their group membership, you just need to know computer names in advance.

      Which is just a layer on top of Powershell. The Active Directory Powershell module is still required.

      It's not required, or that module is included already in Windows 10 by default. Because I haven't had to install it on any machine I managed with Ansible.

      "win_domain_group_membership requires the ActiveDirectory PS module to be installed"
      https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/windows/win_domain_group_membership.ps1

      They have it in the documentation as well "This must be run on a host that has the ActiveDirectory powershell module installed."
      https://docs.ansible.com/ansible/latest/modules/win_domain_group_module.html

    • wrx7mW

      Server 2016 - Force Default Update Server to WSUS Server Via GPO

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows windows server 2016 wsus windows update windows updates gpo pswindowsupdate powershell
      4
      2 Votes
      4 Posts
      10k Views
      dbeatoD

      @wrx7m said in Server 2016 - Force Default Update Server to WSUS Server Via GPO:

      @dbeato said in Server 2016 - Force Default Update Server to WSUS Server Via GPO:

      This would have happened on Server 2012 R2 as well, dual scan has been around and causes a lot of problems as you noted.

      It is strange that I didn't have these issues in 2012 R2. I essentially copied the same GPO for 2012 R2 and made some minor changes to it to convert it for 2016. My 2012 R2 show the correct default service.

      Weird, I have various Server 2016and now 2019 with WSUS and while dual scan was an issue for me on Server 2012/ 2012 R2 not anymore.

    • wirestyle22W

      Finding who Changed a Property of a Active Directory User in Powershell

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion powershell
      20
      0 Votes
      20 Posts
      848 Views
      wirestyle22W

      @wrx7m said in Finding who Changed a Property of a Active Directory User in Powershell:

      @wirestyle22 said in Finding who Changed a Property of a Active Directory User in Powershell:

      @wrx7m said in Finding who Changed a Property of a Active Directory User in Powershell:

      @wirestyle22 said in Finding who Changed a Property of a Active Directory User in Powershell:

      @wrx7m It's just an auto-generated e-mail telling me that Azure can't sync the user because the UserPrincipleName is in the wrong format

      Right, but they were typing that sentence to someone. Was it in a logged conversation?

      I'm not allowed to search people's e-mails. It might be though

      Just saying that someone who was allowed could do that.

      No one is unfortunately. We have to have a reason to go look. Would need to be approved by my boss. I have access to do it, but I am now allowed.

    • wrx7mW

      PSWindowsUpdate - Use PowerShell (and other tools) to Automate Windows Updates

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion powershell pswindowsupdate windows server windows 10 windows updates wsus pdq deploy
      3
      7 Votes
      3 Posts
      4k Views
      wrx7mW

      @jt1001001 Thanks. If you are running from PDQ deploy, you won't see anything. But, if you are doing it from PS/ISE or similar, that would be a great help.

    • JaredBuschJ

      Need a good example of getting powershell arguments

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved IT Discussion powershell scripting parameters
      3
      1 Votes
      3 Posts
      702 Views
      ObsolesceO

      @JaredBusch said in Need a good example of getting powershell arguments:

      I'll hit the google later, because I am on other things, but I found that something I touched today could very easily be improved if I can add parameter handling to the powershell script.

      Now, the basics are easy as it is all in the $ARGS variable/object.

      But I want to have some safety checking. because it is easier to do things right the first time.

      Example: I want a parameter to note if I should make the thing being done the default.

      I can pass a 1 like dothing.ps1 1 and I can simply code something to check $ARG[0] eq "1" but that is not very explanatory to the person using the script.

      This is more explanatory dothing.ps1 -default for a command.

      So has anyone seen a good example of parameter handling that I can put into my dothing.ps1 script?

      I'm not sure I understand exactly what you mean.

      Taking a guess here, but how I understand is that you'd want to add this at the top of your script:

      [cmdletbinding()] param ( [Parameter()] [Switch]$Default ) if ($Default) { Write-Host "The -Default parameter was specified." } else { Write-Host "The -Default parameter was NOT specified." }

      Doing that will give you the following output:

      PS > .\JBTest.ps1 -Default The -Default parameter was specified. PS > .\JBTest.ps1 The -Default parameter was NOT specified.

      If you want to accept input from a pipeline to work with, let me know.

    • JaredBuschJ

      Recovering email from O365 RecoverableItems

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion powershell remote powershell o365 email recovery
      1
      8 Votes
      1 Posts
      532 Views
      No one has replied
    • wirestyle22W

      Quick List of Useful Powershell Commands

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion powershell
      7
      1 Votes
      7 Posts
      447 Views
      EddieJenningsE

      @wirestyle22 said in Quick List of Useful Powershell Commands:

      @IRJ said in Quick List of Useful Powershell Commands:

      @wirestyle22 said in Quick List of Useful Powershell Commands:

      @IRJ Every day is like 12 hours of work in an 8 hour day and that's when I don't have random things thrown at me. I am working on the weekend but it's mostly in Linux. May need to make time

      You could probably feel comfortable with it in a week if you used it for everything. It is quite amazing how much you can feel lost with something one day and the next day you 100% get it. This happens alot and learning isn't always linear. There is generally a break through period.

      Yeah I just don't have the time. Everything has to be fixed immediately here. There is no room for it unfortunately. I'm going to go through the book @Dashrender and I both purchased called Learn Powershell in a Month of Lunches

      You learn stuff one bite at a time. My PowerShell chops are much better after a year at my current gig. And they improved doing one task at a time. Like that cmdlet I posted for finding user names. I did that enough to where I started to understand exactly what I'm telling the cmdlet to do, which leads to learning other cmdlets and such quicker.

    • wirestyle22W

      Copy Users from one AD Group to Another

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows server 2008 r2 powershell
      2
      1 Votes
      2 Posts
      365 Views
      wirestyle22W

      NVM. Decided to work randomly.

    • JaredBuschJ

      Use Exchange PowerShell to get mailbox usage

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion exchange 2010 powershell exchange powershell mailbox usage
      1
      6 Votes
      1 Posts
      328 Views
      No one has replied
    • scottalanmillerS

      Get Windows Network Adapter NIC Speed with PowerShell

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows windows 10 windows server powershell networking
      1
      2 Votes
      1 Posts
      214 Views
      No one has replied
    • scottalanmillerS

      PowerShell Determine if Running 32 bit or 64 bit OS

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion powershell windows
      5
      0 Votes
      5 Posts
      1k Views
      scottalanmillerS

      @manxam so much longer, though. I had checked that out, but find the other to be better.

      However if you are writing a script to fill out a form, I can see this being handier.

    • DustinB3403D

      Folder Monitor and notify

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows administration notifications powershell
      15
      0 Votes
      15 Posts
      739 Views
      ObsolesceO

      A simple scheduled task to run a simple PoSh script would be easiest IMO.

    • EddieJenningsE

      Deploy Active Directory via PowerShell

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion server 2019 windows administration active directory powershell
      3
      5 Votes
      3 Posts
      556 Views
      EddieJenningsE

      @Romo said in Deploy Active Directory via PowerShell:

      Great Job @EddieJennings !!, Really liked the flow and tempo of the video 😃

      Thanks 😄

    • scottalanmillerS

      Managing Windows Local Users with PowerShell

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows sam windows administration system administration windows administration powershell shell command line cli
      14
      2 Votes
      14 Posts
      1k Views
      scottalanmillerS

      Topic has been forked, please keep discussions of OS comparisons to a different thread.

    • scottalanmillerS

      PowerShell: Running the Get-Command command in a remote session reported the following error

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion powershell ssh get-command windows 10 windows windows 10 1809
      25
      0 Votes
      25 Posts
      11k Views
      T

      @scottalanmiller I realise this is an old topic, but I've been fighting something similar all day. As it turns out, the implementation of PTY (and also TTY) has changed in recent versions of OpenSSH for windows. When the SSH session is built from within a script, the new OpenSSH implementation detects that the session is not setup from an interactive terminal, and therefore does not assign a PTY to the session, which results in the unability of the Get-Command command to send its output to STDOUT, hence the access denied error. Solution is (at least in the situation I am in) to use the -t (or even -tt) flag with the ssh command to set up the session

    • scottalanmillerS

      Shell Speeds, Bash and PowerShell

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion bash shell powershell
      91
      0 Votes
      91 Posts
      10k Views
      RojoLocoR

      ^^^ It's always hilarious when a scumbag scammer thinks their input is valuable.

    • RomoR

      Robocopy script not running from task scheduler

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows 2012 r2 robocopy powershell
      22
      1 Votes
      22 Posts
      5k Views
      RomoR

      @Obsolesce Haven't tried it by running it directly as SYSTEM, it has been run as a user and checked to be run with the highest privileges. As it was when it was working before.

    • wrx7mW

      PowerShell - Off-boarding Script

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion powershell windows server active directory ad script scripting office 365 microsoft password password reset
      12
      1 Votes
      12 Posts
      3k Views
      dafyreD

      @wrx7m said in PowerShell - Off-boarding Script:

      @dafyre said in PowerShell - Off-boarding Script:

      @wrx7m said in PowerShell - Off-boarding Script:

      @dafyre I think I found where you got it - https://www.powershelladmin.com/wiki/Powershell_prompt_for_password_convert_securestring_to_plain_text

      Anyway, I am not sure where, in my script, I should place that function.

      You'd put the actual function at the top of your script, and then just

      $myPassword=convertFrom-SecureToPlain -securepassword $MySecurePassword

      Wherever you need the password in plain text form.

      Thanks. It mostly works. The only problem is that it isn't actually using the password I specify at the top. It is somehow generating its own and then writing it at the end. I put in

      write-host "Plain Text Says: $plainText"

      and it shows the password that I typed in for the secure variable at the beginning, followed by the one that it generated.

      Plain Text Says: $#@%4#@177 Jof91348

      Works fine for me here.... Check and make sure you don't have an extra write-host or anything somewhere.

      4a0db1d0-785c-4771-9ad2-9cec6cb0434a-image.png

    • RojoLocoR

      Use Powershell to audit Windows service accounts

      Watching Ignoring Scheduled Pinned Locked Moved Solved IT Discussion ps powershell scripting windows
      6
      3 Votes
      6 Posts
      1k Views
      RojoLocoR

      @Kelly said in Use Powershell to audit Windows service accounts:

      Unless you're wanting to use Powershell for a learning experience you might look at something like this: http://www.cjwdev.com/Software/ServiceCredMan/Info.html. If you still want to use the Powershell route this might be a good way to check the success of your script.

      That looks like it will do exactly what we want... thanks for the link.

    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 10
    • 11
    • 4 / 11