Showing posts with label Windows OS. Show all posts
Showing posts with label Windows OS. Show all posts

Saturday, July 29, 2017

What is mssql-scripter?

In your SSMS on your computer you can use the Generate Scripts drop-down
menu to create scripts for database objects as shown here for Northwind database on SQL Server 2016 SP1.

However, the above is for SQL Server on Windows Platform. However, mssql-scripter tool provide the same functionality as Generate Scripts wizard on SQL Servers on Linux and macOS. Of course mssql-scripter would work on Windows as well.

Using mssql-scripter based on Python you can generate T-SQL scripts for objects on SQL Servers, Azure SQL database and Azure SQL Data Warehouse.

The generated script is saved to a .sql file or, on Linux can be piped to standard Unix utilities (sed, awk and grep ). The scripts can be checked into source control systems as well.

The source code for mssq-scripter is found here:
https://github.com/Microsoft/sql-xplat-cli

Friday, April 10, 2015

How do you create a Windows User?

Let us say you have a computer and you own it. When you installed the operating system you became the owner of the computer and hence its administrator. If others want to use the computer (the local account) than you as the administrator should create a new user and provide a password. You can also set the life time of that password. When so created each user has his own folder; has his own profile and shares a common folder (Public) with the other users which makes it possible to share files.

 As the creator/installer of SQL Server has two options for authentication to log into the SQL Server (a Windows Service), either Windows Authentication or SQL Server authentication. Any Windows user (any of the users of the computer) can be set to log-in to the SQL Server if the computer administrator sets up the user to log-in.

This post shows the first part of creating a new user to a computer (desktop, laptop or a tablet).


Step 1:
Go to Control Panel | System and Security | Administrative Tools | Computer Management. You should be able to see the Local Users and Groups folder. Right click User and click on New User... as shown.

NewUser1

The New User window is displayed as shown.

Step 2:
Insert the name of the New User, herein UserX, the Full name as well as the Description can be provided if needed. Herein only a Description is provided.

NewUser2
 
You need to provide a password and confirm it. Even in Windows 8.1 password strength is not a problem. There are options to set how long a password can be active and whether it needs to expire. You as the administrator can also disable the account if it needs (employee leaves, tenders resignation). Herein the default choice has been changed and User Cannot change password and Password never expires has been chosen.
 
Step 3:
Click Create and it is done as shown in the Computer Management console. Now UserX can access the computer with the password you have created. You can now access his properties by right clicking UserX to bring up the properties.














NewUser3
 
 
Some interesting posts can be found here:
http://hodentekPlus.blogspot.com


 

Friday, October 17, 2014

What is DISM (Deployment Image Servicing and Management)?

DISM is short for Deployment Image Servicing and Management. It can be used in new deployments as well as repairing the local image (the OS on the laptop or desktop). It is a very useful tool to know.

It works on many Windows platforms:
  • Windows 8
  • Windows 81
  • Windows Server 2012
  • Windows Server 2012 R2
  • Windows 7
  • Windows Server 2008 R2
Also review this link for Windows 7 related information:
 


Good news is it is installed with Windows 8.1 and is found here typically:
C:\windows\System32

If you search for it you may find it in several folders.
These are listed in my Windows 8.1 Professional (x64).











How do you use it?
It is a command line tool and you need to bring up command processor with administrative privileges
(Run As Administrator) also know as elevated mode. If you are unable to run cmd.exe in elevated mode like it happenned to me follow this link for the procedure to run in elevated mode.
http://hodentekhelp.blogspot.com/2014/10/how-to-run-command-processor-in.html
Now type dism /? after the C:\ prompt. You get the help file as shown and you get to display the file
details and its usage.
--------------------
Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

C:\Windows\system32>dism /?
Deployment Image Servicing and Management tool
Version: 6.3.9600.17031


DISM.exe [dism_options] {Imaging_command} []
DISM.exe {/Image: | /Online} [dism_options]
         {servicing_command} []

DESCRIPTION:
  DISM enumerates, installs, uninstalls, configures, and updates features
  and packages in Windows images. The commands that are available depend
  on the image being serviced and whether the image is offline or running.

GENERIC IMAGING COMMANDS:
  /Get-MountedImageInfo   - Displays information about mounted WIM and VHD
                            images.
  /Get-ImageInfo          - Displays information about images in a WIM or VHD
                            file.
  /Commit-Image           - Saves changes to a mounted WIM or VHD image.
  /Unmount-Image          - Unmounts a mounted WIM or VHD image.
  /Mount-Image            - Mounts an image from a WIM or VHD file.
  /Remount-Image          - Recovers an orphaned image mount directory.
  /Cleanup-Mountpoints    - Deletes resources associated with corrupted
                            mounted images.
WIM COMMANDS:

  /Capture-CustomImage    - Captures customizations into a delta WIM file on a
                            WIMBoot system. Captured directories include all
                            subfolders and data.
  /Get-WIMBootEntry       - Displays WIMBoot configuration entries for the speci
fied disk volume.
  /Update-WIMBootEntry    - Updates WIMBoot configuration entry for the specifie
d disk volume.
  /List-Image             - Displays a list of the files and folders in a
                            specified image.
  /Delete-Image           - Deletes the specified volume image from a WIM file
                            that has multiple volume images.
  /Split-Image            - Splits an existing .wim file into multiple
                            read-only split WIM (SWM) files.
  /Export-Image           - Exports a copy of the specified image to another
                            file.
  /Append-Image           - Adds another image to a WIM file.
  /Capture-Image          - Captures an image of a drive into a new WIM file.
                            Captured directories include all subfolders and
                            data.
  /Apply-Image            - Applies an image.
  /Get-MountedWimInfo     - Displays information about mounted WIM images.
  /Get-WimInfo            - Displays information about images in a WIM file.
  /Commit-Wim             - Saves changes to a mounted WIM image.
  /Unmount-Wim            - Unmounts a mounted WIM image.
  /Mount-Wim              - Mounts an image from a WIM file.
  /Remount-Wim            - Recovers an orphaned WIM mount directory.
  /Cleanup-Wim            - Deletes resources associated with mounted WIM
                            images that are corrupted.

IMAGE SPECIFICATIONS:
  /Online                 - Targets the running operating system.
  /Image                  - Specifies the path to the root directory of an
                            offline Windows image.

DISM OPTIONS:
  /English                - Displays command line output in English.
  /Format                 - Specifies the report output format.
  /WinDir                 - Specifies the path to the Windows directory.
  /SysDriveDir            - Specifies the path to the system-loader file named
                            BootMgr.
  /LogPath                - Specifies the logfile path.
  /LogLevel               - Specifies the output level shown in the log (1-4).
  /NoRestart              - Suppresses automatic reboots and reboot prompts.
  /Quiet                  - Suppresses all output except for error messages.
  /ScratchDir             - Specifies the path to a scratch directory.

For more information about these DISM options and their arguments, specify an
option immediately before /?.

  Examples:
    DISM.exe /Mount-Wim /?
    DISM.exe /ScratchDir /?
    DISM.exe /Image:C:\test\offline /?
    DISM.exe /Online /?
C:\Windows\system32>

-------------
You can get more information as shown in the examples above.

If some of your files are corrupted and causing problems you can use this tool to see which of them are corrupted and also heal them using uncorrupted versions.