Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account


Photo

Batch file request

- - - - -

  • Please log in to reply
3 replies to this topic

#1
engert100

engert100

    Junior

  • Member
  • Pip
  • 59 posts
Hi,

does anyone know if it's possible to create a batch file to acomplish the following.

1. Check if machine is joined to domain.

2a. If it is joined to the domain create a new user account.

2b. If it's not joined to the domain create a different user account.

I am clear in NET USE command and how to add/delete users.
What i'm not clear on, is how to check if a machine is joined to the domain using a batch file.

Any ideas are appreciated.

Thanks.
My signature


How to remove advertisement from MSFN

#2
Scr1ptW1zard

Scr1ptW1zard

    Junior

  • Member
  • Pip
  • 67 posts
I am not sure if this works 100% of the time, but I have used this in the past:

if %userdomain% EQU %computername% (
  echo Not a member of a domain.
) else (
  echo Member of %userdomain%
)

I have noticed that when a system is not a member of a domain, both
the userdomain and computername environment variables are the same.
Only tested under XP.
--== Scr1ptW1zard ==--

#3
engert100

engert100

    Junior

  • Member
  • Pip
  • 59 posts
Thank you very much.
This works!
My signature

#4
engert100

engert100

    Junior

  • Member
  • Pip
  • 59 posts
I have one more question and if this works i'll be all set.

Is there an option in Winnt.sif where you can give the user a choice: Do you want to join this machine to the domain or to a workgoup?
If it can't be done through winnt.sif, is there any other options to make this possible.

Thank you.
My signature




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users



How to remove advertisement from MSFN