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

      Understand CMD CLI to Powershell Variable

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion cmd cmdlet ps powershell chocolatey batch script scripting
      2
      0 Votes
      2 Posts
      1k Views
      dbeatoD

      @gjacobse So basically you want to iterate through a list of computers the same script correct? So do you have a list of computers? What are other steps on your script? because what we can do is the following

      *$computers = import-csv -Path "c:\script\computers.csv" foreach ($oldname in $computers){ Rename-Computer -NewName $newname -DomainCredential domain\admin -Restart}

      This assumes you have a CSV file with a oldname and new name columns with computer names.

    • gjacobseG

      Windows CLI: List printers

      Watching Ignoring Scheduled Pinned Locked Moved Solved IT Discussion windows printers cmd cmdlet powershell
      6
      1 Votes
      6 Posts
      2k Views
      art_of_shredA

      Thanks! That's helpful.

    • gjacobseG

      PowerShell command: Event Time

      Watching Ignoring Scheduled Pinned Locked Moved IT Discussion windows powershell cmdlet
      6
      2 Votes
      6 Posts
      3k Views
      gjacobseG

      @Martin9700 said:

      @g.jacobse said:

      0x01d0b26dc6a4a844

      That value isn't a .NET date/time value so Get-Date won't be able to process it properly (hence the year 0415). So I tried this: http://superuser.com/questions/398983/how-do-i-decode-the-faulting-application-start-time-in-a-windows-event-log-ent

      (get-date "01/01/1601").AddSeconds(0x01d0b26dc6a4a844 / 10E+6)

      And got:

      Monday, June 29, 2015 1:16:14 PM

      Seems much better!

      Interesting - same link I used. I didn't notice that the read through.

    • 1 / 1