Windows: What Group(s) Security Does My User Have

The Smart Panda - WindowsWindows Security – User Groups

So have you working in a windows environment and found yourself not able to access a specific directory because of windows security? Well I find many times when working on systems at clients that they have done some odd security things to their directory structures.  So the question becomes what groups does my user profile have access to so that I can determine what level of access I have to the directory(s) in question.

From the command line use this command:

gpresult /r

This will generate a extensive list of information but at the end it will show the “User Settings”

Smart Panda - gpresults command

Windows: Add An Network Drive from Command Line

Smart Panda - Network DriveWindows Network Drive Mapping:

Every once and awhile you will be working away and with all the new protections in windows, you will have to run something as administrator. This is fine however, occassional that program you are running will require that you access a network drive. However, sometimes, you may not be able to access that network drive because of the privileges.  If the network drive is mapped as you the user, the administrator will not see the mapped drive that you have.

A nice and quick way to solve this problem is to map a network drive as the administrator.  To do this run the command line program (cmd) as administrator, which will give you the nice old fashion “DOS” window.  From here simply execute the command:

net use

This will list all the network drives that are mapped for the administrative user.  If you don’t see the drive you want add it:

net use {drive-letter} {unc-path}

so if you wanted the drive \\myserver\myshare to be mapped to the z: drive enter:

net use z: \\myserver\myshare


Smart Panda - IdeaIf you want to get fancy, you can add credentials and persistence with the following command:

net use {drive-letter} {unc-path} /user {user-name} {password} /P:Yes

 

Cisco AnyConnect – Fails To Initialize Subsystem

Well, it has been one of those weeks.  Correction, it has been one of those months.  I am finally sitting back in my home office ready to jump on a clients VPN and Cisco AnyConnect decides that today is NOT the day.

So off to Google we go and sure enough there are a lot of blogs with comments about Cisco AnyConnect failing to initialize subsystem.  A common one I say said to set the GlobalUser default of I.E. to disabled in the registry or set the I.E. to work online.  However, that did not fix my problem.

A little more reading and I found Chris Tierney’s blog with the solution that worked for me.  Basically with the patches/hot fixes that Windows released over the weekend it messed with the compatibility modes.  So once you change the vpnui.exe to Windows 8 compatibility mode everything works like on charm.

Big Smiles….. Big Smiles…….

Remove a File Lock on Windows 2008R2

Sometimes you need to remove a locked file in a windows environment, and this should do the trick:

Open Administrative Tools -> Share and Storage Management -> Actions -> Manage Open Files

Here you are able to see all locked files and folders on this server.  To clear a lock, select the relevant file and click “Close Selected”. Note that this should only be done if the user definitely is not using the the file, otherwise data loss may occur.

Converting dos to unix ascii files

There is just nothing in this world that is universal and that even includes straight up text files. When carriage returns are stored in windows they are stored as Carriage Return & Line Feed, however, in unix they are stoed as just Carriage Return.

So when you ftp a file from windows to unix sometimes you will see ^M characters at the end of each line. This is because the files has been transferred as a binary file versus an ascii file. Most ftp (sftp, ftps, etc..) programs will convert the carriage returns correctly if the file is set to transfer in ascii mode based on the operating system it is going to.

However, if by chance you end up with a “dos” based file on your unix system and you want to convert it. A quick simple trick is to use the vi editor using the the :set ff command.

Simply open the text file in the vi editor, and type
:set ff=unix

This will change the file format from dos to unix based and the carriage return problem should be solved!