+ Post New Thread
Results 1 to 3 of 3
Windows Server 2008 R2 Thread, Need some help with Powershell script i have in Technical; we are going to open teminal service to staff through Frog but to a limited number of PC's and want ...
  1. #1

    Join Date
    Jan 2008
    Location
    Durham
    Posts
    6
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Need some help with Powershell script i have

    we are going to open teminal service to staff through Frog but to a limited number of PC's and want to set the End a disconnected session time i have a quest Powershell command that works if I type it in to the Powershell script window but dose not work if I put it in to a PS1 file the following is the script command that works

    import-csv C:\ps1scripts\Sessions.csv | ForEach-Object {Get-QADUser -Name $_.Name |Set-QADUser -TsMaxDisconnectionTime '00.01.00'}

    it take a scv file and rins the getQADUser command to get the user then the set command to set the Endadisconnected session time to 1 min how ever the command dose not work form a PS1 file it returns the following error

    Set-QADUser : Cannot bind parameter 'TsMaxDisconnectionTime'. Cannot convert value "00.01.00" to type "System.TimeSpan"
    . Error: "Input string was not in a correct format."
    At C:\ps1scripts\sessions.ps1:1 char:105
    + import-csv Sessions.csv | ForEach-Object {Get-QADUser -Name $_.Name |Set-QADUser -TsMaxDisconnectionTime <<<< '00.01
    .00'}

    for each user
    itis going to be somthing simple i am missing but can any one see why

  2. #2


    Join Date
    Feb 2007
    Location
    51.403651, -0.515458
    Posts
    8,900
    Thank Post
    226
    Thanked 2,676 Times in 1,973 Posts
    Rep Power
    787
    Does this work?

    Code:
    Add-PSSnapin Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue
    Import-CSV C:\ps1scripts\Sessions.csv | ForEach-Object { Get-QADUser -Name $_.Name | Set-QADUser -TsMaxDisconnectionTime '00.01.00' }

  3. #3

    Join Date
    Jan 2008
    Location
    Durham
    Posts
    6
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    unfortunately no it give the same error

    but you caused me to look again and i found the error thank you '00.01.00' needs to be '00:01:00'

SHARE:
+ Post New Thread

Similar Threads

  1. Need Some Help With WD SES
    By Harlynn in forum Hardware
    Replies: 4
    Last Post: 8th January 2011, 06:07 AM
  2. Replies: 6
    Last Post: 30th September 2010, 03:17 PM
  3. Replies: 0
    Last Post: 22nd November 2009, 11:07 AM
  4. Replies: 2
    Last Post: 10th October 2009, 11:12 PM
  5. Replies: 11
    Last Post: 7th March 2008, 02:28 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •