Results 1 to 4 of 4

Thread: configure remote logon script via c#

  1. #1
    Join Date
    May 2010
    Posts
    3

    configure remote logon script via c#

    Hey,

    I have a c# code that connects remotely to a winServer2008 machine (with a local user of that machine).

    How do I configure via automated code the logon script that will be executed as soon as the connection is established ?

    Cheers,

  2. #2
    Join Date
    Mar 2010
    Posts
    2,529

    Re: configure remote logon script via c#

    I'm also trying to write a logon script that allows for the cluster
    A user to mount the right printer sharing networks ...
    I made a mistake on the line:
    StrGroups = LCase (Join (CurrentUser.MemberOf))
    He said "JOIN: incompatible type"
    I did a test and strgroups the msgbox is not empty myself out well
    Something: CN = GCSI, OU = GROUPS, ...

  3. #3
    Join Date
    May 2010
    Posts
    3

    Re: configure remote logon script via c#

    My problem is different.
    I have the bat file.

    Don't know how to set it to the logon script programmaticly.

  4. #4
    Join Date
    Jun 2006
    Posts
    623

    Re: configure remote logon script via c#

    A batch file Logon script can be created in Many languages (VBS File MS-DOS, Powershell, ...). We just understand that it is the client that the session will open that will run this script, it will be able to run it. If you create a Logon Script in Powershell, well ... you are a precursor Powershell is not implemented as a station on 2000, XP or Vista. If you want to do Powershell must be installed on the client machine ...

    We will create a simple script file name such logonscript.vbs where we will put the following code

    Code:
    '************************************************* *****************
    'File logonscript.vbs
    'Version 1.0
    '************************************************* *****************
    
    On Error Resume Next
    
    Set objNetwork = WScript.CreateObject ("WScript.Network)
    
    WScript.Sleep 1000
    
    objNetwork.RemoveNetworkDrive "R"
    objNetwork.MapNetworkDrive 'R', '\ \ servername \ sharename'
    This simple code in VBScript allows you to map sharing \ \ Servername \ sharename on the network drive R: \ the workstation on which the logon script will run.

Similar Threads

  1. Replies: 3
    Last Post: 17-08-2010, 09:06 PM
  2. Run logon script
    By Sandy22 in forum Operating Systems
    Replies: 6
    Last Post: 08-06-2010, 10:16 AM
  3. Bat file for logon script
    By adam2010 in forum Windows Software
    Replies: 1
    Last Post: 10-05-2010, 11:42 AM
  4. Logon Script Does Not Work
    By c54618 in forum Operating Systems
    Replies: 1
    Last Post: 01-05-2008, 08:40 AM
  5. logon script help
    By HandelMan in forum Small Business Server
    Replies: 1
    Last Post: 31-01-2008, 03:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,927,127.46802 seconds with 17 queries