Jump to content

Search the Community

Showing results for tags 'Terminal services'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum
  • AutoIt

Calendars

  • Community Calendar

Found 2 results

  1. This function to set Terminal Service information that i wrote a few years ago (with water's help), always worked in Windows XP, but no longer seems to work now that we changes over to Windows 7 machines. all other AD functions seem to work fine. could there be something missing in windows 7 like a .dll or something? Func _AD_SetTSProfile($sAD_User) If Not _AD_ObjectExists($sAD_User) Then Return SetError(1, 0, 0) Local $ID = $sAD_User If StringMid($sAD_User, 3, 1) <> "=" Then $sAD_User = _AD_SamAccountNameToFQDN($sAD_User) ; sAMACccountName provided $oAD_User.TerminalServicesProfilePath = "Servertsprofiles" & $ID $oAD_User.TerminalServicesHomeDirectory = "Servertshome" & $ID $oAD_User.TerminalServicesHomeDrive = "Z:" $oAD_User.AllowLogon = True $oAD_User.SetInfo() If @error <> 0 Then Return SetError(@error, 0, 0) Return 1 EndFunc ;==>_AD_SetTSProfile ----------------------------------------------------------------------------------------- i ran this small script for the purpose of troubleshooting #Include <AD.au3> #Include <lauze.au3> $sAD_User = "TestUser" _AD_Open("","","DC=XXX,DC=XXX","Server.XXX.XXX","CN=Configuration,DC=XXX,DC=XXX") $result = _AD_SetTSProfile($sAD_User) ConsoleWrite(" " & $result & " - " & @error & " - ") _AD_Close() ---------------------------------------------------------- results: >Running:(3.3.8.1):C:Program Files (x86)AutoIt3autoit3.exe "P:DocumentsAuto Ittestts_win7.au3" --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop 0 - -2147352570 - +>14:02:37 AutoIt3.exe ended.rc:0 >Exit code: 0 Time: 0.820
  2. So, here's my problem: My script is running as Windows service and must every second or so get idle time of a specific user logged on via Remote Desktop. I didn't have any problem getting current user's idle time (in this case, the "current user" is SYSTEM), however I found getting another user's idle time to be very difficult. I imagine one way would be to write output of "query user" to a file and read from it, but I'd really like to avoid unnecessary writing on disk. Another way would be to run a separate script in each user's context and program it to report idle time back to the main script. I don't like this option too - too messy, too many unnecessary processes running. I found this interesting and 90% undocumented function named WinStationQueryInformationW. Here someone got the results I want from it, but it's written in C... I tried to "translate" that into AutoIT language, but I don't really have enough knownledge in this area. Is there anybody out there who could help me to make use of that function? I'm also looking for alternatives...
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.