【Site Setup】Windows User Group and User 

# Introduction #
I am trying to check how Windows User Group registered to Sharperlight is dealt when I login.
It was in case of the Windows Group holds my windows user account, but my user account is not registered to Sharperlight.

# The Current Settings #
## Sharperlight Users ##
My windows account **{MyPCName}\MikiY** is a Windows Admin user, and it is also registered to Sharperlight so when I used the account to login to Windows and access to Sharperlight, I can login to Sharperlight without inputing any credentiales.

The following users are registered in Sharperlight Site Setup.
**{MyPCName}\MikiY** user
This user is Windows (Domain) Admin user, and also Admin for Sharperlight.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/31ff2eab-c68d-01c3-66fa-7302676783d4.png)

**admin** user
This is a named user for Sharperlight and not a Windows user, and it has admin right for Sharperlight.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/46f9d1ab-68f2-89d2-8778-c5121d1a8870.png)

::: note warn
If an admin user for Sharperlight gets disabled when it is only one admin user, you will get in trouble.
I think that it is better to have multiple admin users with password protected.
:::


## Windows User Groups and Users ##
Let's have a look the Windows User Groups here.
**Finance Group**
Finance A, B, C and MikiY(Local Admin) users belong to this group.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/4ed0e845-cb2b-aa0e-56da-8761ff104775.png)

**Consulting Group**
Consultant X, Y, Z and MikiY(Local Admin) users belong to this group.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/66fbafd0-785c-f797-71ca-4e4b37100005.png)

# Importing Windows User Groups to Sharperlight #
Let's import the Windows users to Sharperlight with Sharperlight Site Setup

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/41479ee4-4d3f-a54a-602f-65dc0b9d791f.png)

Choose a template from the existing users, the all settings of this selected template will be applied to all imported users or groups as default.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/5eaf65ed-5714-a0df-43c7-0e2ec925ed91.png)
Set the domain name where we want to import users or groups from.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/f0aecfa6-930a-545c-b4ab-51936757492c.png)
After clicking the OK button, this list will be generated.
Users are picked up from the specified domain, and this list is generated.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/50badaf6-edaf-19e1-399c-102b5e34f33f.png)
Only Windows Users are picked up as default and not user groups from the specified domain, we can amend the list if we want to import Windows User Groups only.
I modify the list as shown below. 
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/4743b186-41f1-8e1b-12f0-8c12ef2c6d38.png)
Then click `OK` to import.
Now we can see the Windows User Groups are in Sharperlight.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/9bb12a39-e51e-4078-5b71-c7e977f5192b.png)

# Verification #
Sharperligh has now two Windows User Groups and one Windows User which is my user account.
They are all enabled and I am on Windows with my account, i.e. **{MyPCName}\MikiY**

In the case of my Windows user account being registered in Sharperlight, when I open Sharperlight Query Builder, I can go in without any permission as I am already accepted by Windows.

There is a way to check which user is currently used.
You can choose `Information` from the right-click menu with the Products lookup dialog in Query Builder.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/ac7cef0a-09cc-feba-37af-80987fd2dd9c.png)
Then you should be able to see the details here. As you can see, **{MyPCName}\MikiY** is used.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/729a02be-5952-9ffc-e68d-a8b8f03af529.png)

As the next check, I disable my account **{MyPCName}\MikiY** in Sharperlight, and try to open Query Builder.
Put `X` at the end of the account name like this to brake the link between the user currently logged in to Windows and the Sharperlight user.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/0de1919c-3922-6b0e-1324-26f780fb2a57.png)
Then log in to Query Bilder and check the information.
It says that my user account currently on Windows is passed to Sharperlight and those Windows user groups are used to get me in as they both have my user account.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2530698/fdda0145-27eb-0da1-e55e-062f268a33a6.png)

# Conclusion #
This is how Windows User Group and Users works for Sharperlight, and this is a way to manage users at Windows side and not Sharperlight side.