יום רביעי, 13 בנובמבר 2013

How to setup Assembly environment


Requirements


Getting started
Download the Irvine’s example program folder:
(I have Visual Studio 2010 so I chose:
Extract it to: c:\Irvine

Creating new project
Copy c:\Irvine\Examples\Project_Sample folder to a new location and open the *.sln file and work on it.


Debugging Tips
In assembly language running debugging mode with registers flags and memory can help you.
First, make sure you are in debug mode.
Put brake point in one of your code lines or press F10 and then the registers option will be available.


Go to Debug >  Windows > Registers:

















You will receive the registers window:







Press right click on the Registers window and check the Flags:



















And you will receive the flags (marked):







For more information you can visit Irvine website: http://www.asmirvine.com/





יום רביעי, 6 בנובמבר 2013

How to check who is currently logged on to windows workstation from command line


Sometimes we want to know who is the logged on user on some windows station.
A simple way to check it is to use wmic command:
WMIC /NODE: xxx.xxx.xxx.xxx COMPUTERSYSTEM GET USERNAME 
Will return the username currently logged into xxx.xxx.xxx.xxx
or
 WMIC /NODE: "workstation_name" COMPUTERSYSTEM GET USERNAME
 will return the username currently logged into "workstation_name"

Open command line: Start > type "cmd" (without quotes) and press enter.
Type the WMIC commands I wrote above, you should receive something like this:

יום שלישי, 29 באוקטובר 2013

How to add user to local administrator group of remote computer



First we will take our input.
We need domain in order to search for the user in the Active Directory the remote computer we want to add the user as admin into and the username of the user who want to be the admin.



Now we want to get inside the local Administrator group inside the remote computer.
In order to do it we will use the [ADSI] adapter.
Explanation:
ADSI stands for Active Directory® Services Interface. Despite the name, ADSI isn’t actually specific to Active Directory.
ADSI can connect to a variety of directory services, including Windows NT®-style directories—not just Windows NT domains, mind you, but also to the local Security Accounts Manager (SAM) on standalone and member computers. 
As the name implies, a type adapter "adapts" a .NET Framework object type into a more consistent, and sometimes simpler, format.
For more information you can visit the great post of Don Jones at:
We will use this adapter in order to access the local administrator group in the remote computer:



After we have the group we will add the user:






יום ראשון, 27 באוקטובר 2013

LNK1123 error when bulding VC++ 2010 project after installing Visual Studio 2012 or .NET Framework 4.5

Problem:
When trying to build a program in Visual Studio 2010 receive an error:


Error      1              error LNK1123: failure during conversion to COFF: file invalid or corrupt                C:\Users\username\documents\visual studio 2010\Projects\nameOfProject\cpp\LINK  cpp

Analyze:
The problem started after installing .NET Framework 4.5
According to Microsoft the issue is caused by a dependency failure of cvtres.exe on msvcr100_clr0400.dll which is shipped with Visual Studio 2010 RTM and eventually updated with a new version when Visual Studio 2012 RTM or .NET Framework 4.5 is installed. 




Resolution:


  • Either disable incremental linking, by going to
    Project Properties
       -> Configuration Properties
           -> Linker (General)
             -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"


  •        or install VS2010 SP1 from Microsoft website:
               http://www.microsoft.com/en-us/download/details.aspx?id=23691







Gets notification on Excel: Automatic update of links has been disabled


Gets notification on Excel: Automatic update of links has been disabled
In some releases of Excel users can receive the following notficiation:










In order to prevent this notification:
Office button > Excel Options > Trust Center > Trust Center Settings > External Content > Enable automatic 
Excel options:






Trust Center > Trust Center Sttings:















Choose External Content and check the Enable automatic update for all Workbook Links (not recommended):












יום שני, 21 באוקטובר 2013

Export group members in AD to CSV file

When you receive task for getting members of a group it can be simply done if the group has 5-10 members.
But sometimes groups have more than 20 users and it can be frustrated.
You can use the following PowerShell commands to export the users:
import-module activedirectory #loading the AD module
get-ADGroupmember groupName



















If we want to see only the names we can use the pipeline: select name









We can also create script that will do it automatically by giving the name of the group and create CSV file with the names to desktop:



















Code can be found here: http://pastie.org/8418008#