• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Reply to: Active Directory

Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "Active Directory"

Collapse

  • EternalOptimist
    replied
    cracked it - simple really

    run create object on a virgin machine.
    the object picks up the log on as the objects username but without applying it

    so , capture it then apply it.


    if its not a virgin machine, you are simply capturing the correct username and then applying it back


    thanks for all the help dudes



    dim objword
    dim myUserName
    dim myUserInitials
    Set objWord = CreateObject("word.Application")
    myUserName = objWord.UserName
    myUserInitials = objWord.UserInitials
    objWord.UserName = myUserName
    objWord.UserInitials = myUserInitials
    objWord.Quit

    Leave a comment:


  • London75
    replied
    Add those reg entries (if they're right) into the "Default User" profile on the machine. That way, they'll be used as the default settings for all users on the box.

    Leave a comment:


  • EternalOptimist
    replied
    thanks both, I will try these ideas in the a.m.



    Leave a comment:


  • lilelvis2000
    replied
    You could try making the entries into the registry.

    HKEY_CURREN_USER\Software\Microsoft\Office\Common\ userInfo

    Save the contents of a sample user into a .reg file and execute it in your bat file

    http://support.microsoft.com/kb/82821

    That may work.

    Leave a comment:


  • NickFitz
    replied
    Originally posted by EternalOptimist View Post
    thanks nick, I tried all that earlier. The problem is that the user running the app has never run office on this virtual machine, so the MSACCESS/OFFICE welcome screen is coming up to say please confirm your initials etc

    I believe at this point it creates the user folders/entries that I am on about, which I called ,erroneously,a user profile. A user would only ever see this screen once, but in the scenario I am describing, they are constantly being allocated to new virtual machines, so they are being promted frequently

    sorry for vague factor 10, but I am a dev not an infr



    There's an MSKB article that might help, although it's full of caveats like "We do not recommend or support Automation to a Microsoft Office application from an unattended user account."

    Leave a comment:


  • EternalOptimist
    replied
    Originally posted by NickFitz View Post
    Leaving 1 aside (as I don't think that's the right approach) I assume from 2 that you are running your BAT file as a scheduled task?

    If so, I think the issue is that, when no user is logged in to the system, the scheduled task will run under the SYSTEM account by default (IIRC). This, I believe, requires the task to run as a service, but Access is an application; I'm not sure if it can run as a service.

    In the Task Scheduler, double-click the task to open its property sheet. On the first tab ("Task") there is a "Run as" section towards the bottom. Make sure this has the username of an account that has the necessary privileges for whatever the task has to do, then hit the "Set password" button to... well, to set the password.

    The task should then run under that account without problems. If it's still failing (or if all those things are already set), you might need to specify assorted Access command line switches in the BAT file at the point where it's started; the /nostartup one will probably be a good place to start. Then try the /user and /pwd ones, or maybe /profile.
    thanks nick, I tried all that earlier. The problem is that the user running the app has never run office on this virtual machine, so the MSACCESS/OFFICE welcome screen is coming up to say please confirm your initials etc

    I believe at this point it creates the user folders/entries that I am on about, which I called ,erroneously,a user profile. A user would only ever see this screen once, but in the scenario I am describing, they are constantly being allocated to new virtual machines, so they are being promted frequently

    sorry for vague factor 10, but I am a dev not an infr



    Leave a comment:


  • NickFitz
    replied
    Originally posted by EternalOptimist View Post
    Active directory question

    1. my tentative solution - I need a vb script that will run as a .bat that will create a user profile structure on a machine.



    2. the actual problem (in case I am talking balls in 1). There is an msaccess application that produces a file for export. The export is run overnight by a bat file.
    If the profiles on the machine have been cleared down, ms office opens a dialogue asking for the user to confirm initials etc. This stops the export bat from running


    TIA
    Leaving 1 aside (as I don't think that's the right approach) I assume from 2 that you are running your BAT file as a scheduled task?

    If so, I think the issue is that, when no user is logged in to the system, the scheduled task will run under the SYSTEM account by default (IIRC). This, I believe, requires the task to run as a service, but Access is an application; I'm not sure if it can run as a service.

    In the Task Scheduler, double-click the task to open its property sheet. On the first tab ("Task") there is a "Run as" section towards the bottom. Make sure this has the username of an account that has the necessary privileges for whatever the task has to do, then hit the "Set password" button to... well, to set the password.

    The task should then run under that account without problems. If it's still failing (or if all those things are already set), you might need to specify assorted Access command line switches in the BAT file at the point where it's started; the /nostartup one will probably be a good place to start. Then try the /user and /pwd ones, or maybe /profile.

    Leave a comment:


  • spoons
    replied
    The profile gets created by the system on logon anyway.

    I might have the wrong end of the stick here?

    Leave a comment:


  • EternalOptimist
    started a topic Active Directory

    Active Directory

    Active directory question

    1. my tentative solution - I need a vb script that will run as a .bat that will create a user profile structure on a machine.



    2. the actual problem (in case I am talking balls in 1). There is an msaccess application that produces a file for export. The export is run overnight by a bat file.
    If the profiles on the machine have been cleared down, ms office opens a dialogue asking for the user to confirm initials etc. This stops the export bat from running


    TIA

Working...
X