2021-11-27 13:24:11 +03:00
# Tweaks for Windows
2024-01-13 18:55:21 +03:00
2021-11-27 13:24:11 +03:00
Tools for managing Windows setting
2021-11-27 12:52:49 +03:00
2021-11-27 13:24:11 +03:00
* [`hvswitch`.cmd ](https://git.hmp.today/pavel.muhortov/tweaks-for-windows#hvswitch-cmd )
2022-12-12 16:14:57 +03:00
* [`rdpusers`.cmd ](https://git.hmp.today/pavel.muhortov/tweaks-for-windows#rdpusers-cmd )
2022-12-29 16:30:21 +03:00
* [`1cibases`.cmd ](https://git.hmp.today/pavel.muhortov/tweaks-for-windows#1cibases-cmd )
2024-01-14 10:15:53 +03:00
* [`dfs-set-active`.ps1 ](https://git.hmp.today/pavel.muhortov/tweaks-for-windows#dfs-set-active-ps1 )
2021-11-27 12:52:49 +03:00
____
2024-01-13 18:55:21 +03:00
2021-11-27 13:24:11 +03:00
## `hvswitch`.cmd
2024-01-13 18:55:21 +03:00
2024-01-14 10:15:53 +03:00
**Description:**
> Microsoft Hyper-V switch on/off
**Dependencies:**
>
> * Windows (tested version 10.0.19043)
2021-11-27 12:52:49 +03:00
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
2024-01-13 18:55:21 +03:00
| 1 | ** [qn]** |execution without pauses| `None` |
| 2 | ** [y]** |enable Hyper-V, if it off| `None` |
| 2 | ** [n]** |disable Hyper-V, if it on| `None` |
2021-11-27 12:52:49 +03:00
Example usage in terminal:
2024-01-13 18:55:21 +03:00
2021-11-27 12:52:49 +03:00
```cmd
2021-11-27 13:24:11 +03:00
.\hvswitch.cmd qn y
2021-11-27 12:52:49 +03:00
```
____
2024-01-13 18:55:21 +03:00
2022-12-12 16:14:57 +03:00
## `rdpusers`.cmd
2024-01-13 18:55:21 +03:00
2024-01-14 10:15:53 +03:00
**Description:**
> RDS Shadow Connection
**Dependencies:**
>
> * Windows (tested version 6.3.9600)
> * permission on target hostname (*gpedit.msc -> Computer Configuration -> Policies -> Administrative Templates -> Windows components -> Remote Desktop Services -> Remote Session Host -> Connections -> Set rules for remote control of Remote Desktop Services user sessions: Full Control without users's permission*)
2022-12-12 16:14:57 +03:00
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
2024-01-13 18:55:21 +03:00
| 1 | ** [host]** |hostname or address with sessions for connect|`None`|
2022-12-12 16:14:57 +03:00
Example usage in terminal:
2024-01-13 18:55:21 +03:00
2022-12-12 16:14:57 +03:00
```cmd
.\rdpusers.cmd ts.domain.local
```
____
2024-01-13 18:55:21 +03:00
2022-12-29 16:30:21 +03:00
## `1cibases`.cmd
2024-01-13 18:55:21 +03:00
**Description:**
> 1CEStart backup/restore settings
**Dependencies:**
>
> * Windows (tested version 6.3.9600)
2024-01-14 10:15:53 +03:00
> * privileged rights (only for backup)
2022-12-29 16:30:21 +03:00
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
2024-01-13 18:55:21 +03:00
| 1 | ** [qn]** |execution without pauses| `None` |
| 2 | ** [b]** |restore | `None` |
| 2 | ** [r]** |backup | `None` |
2022-12-29 16:30:21 +03:00
2024-01-13 18:55:21 +03:00
### `1cibases`.cmd setup
2022-12-29 16:30:21 +03:00
2024-01-13 18:55:21 +03:00
1\. Create and edit `%SYSTEMDRIVE%\Users\Default\AppData\Roaming\1C\1CEStart\ibases.v8i` manually or by backup your settings running ```.\1cibases.cmd qn b``` as Administrator. New user profiles will have this `ibases.v8i` .
2\. Only if you need to rewrite user changes at their logon:
>
> * Create `%SYSTEMDRIVE%\Windows\System32\GroupPolicy\User\Scripts\Logon\1cibases.cmd`
2024-01-14 10:15:53 +03:00
> * gpedit.msc -> User Configuration -> Administrative Templates -> System -> Logon -> Run these programs at user logon: `%SYSTEMDRIVE%\Windows\System32\GroupPolicy\User\Scripts\Logon\1cibases.cmd qn r`.
____
## `dfs-set-active`.ps1
**Description:**
> Set active server for used DFS namespaces.
**Dependencies:**
>
> * Windows (tested versions 6.1.7601, 10.0.19045, 10.0.22621)
> * privileged rights
| POSITION | PARAMETERS | DESCRIPTION | DEFAULT |
|-----------|--------------|------------------------|---------------|
| 1 | ** -child** |internal execute switch | `false` |
### `dfs-set-active`.ps1 setup
1\. Create config file.
```powershell
@"
\\domain.local\dfs_namespace_1\share_dir_1:\\server_1.domain.local\share_dir_1
\\domain.local\dfs_namespace_2\share_dir_2:\\server_2.domain.local\share_dir_2
"@ | Out-File $env:\Windows\System32\GroupPolicy\Machine\Scripts\Startup\dfs-set-active.cfg -Encoding "UTF8"
```
2\. Create startup script.
gpedit.msc -> Computer Settings -> Policies -> Windows Settings -> Scripts (Startup/Shutdown) -> Startup -> PowerShell Scripts: `%SYSTEMDRIVE%\Windows\System32\GroupPolicy\Machine\Scripts\Startup\dfs-set-active.ps1` .