Computing Windows

Nice Windows 10 Trick

To find the info about a motherboard in a windows computer, open a terminal and run this:

z:\>wmic baseboard get product,Manufacturer,version,serialnumber

No spaces after the commas.

Computing Windows

Making a Windows 10 Bootable USB Drive

I’m trying to update some computers to Windows 10. I have an iso file with windows 10 on it. I could write it to a dvd, but most of the computers I’m updating no longer have dvd players. I’d like to write it to a usb drive and boot from that. Over the past few days, I’ve found that this is a problem with windows 10 because there is one file, sources/install.wim that’s over 4gb. My systems will only boot from a fat or fat32 partitioned drive. On those drives, 4gb is the maximum file size. I also normally work on a mac, so I was trying to find a way to make these bootable usb drives on my mac. I was not successful. The key to making this work is to use a windows program called split-windowsImage. Here’s what I did, though making the NTFS filesystem on my usb drive was not necessary.

On my mac, I had a 1tb drive sitting around, so I partitioned it with two FAT32 partitions.

$ diskutil partitionDisk disk3 MBR fat32 DOS 300gb FAT32 NTFS 300gb
Started partitioning on disk3
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk3s1 as MS-DOS (FAT32) with name DOS
512 bytes per physical sector
/dev/rdisk3s1: 585794432 sectors in 9153038 FAT32 clusters (32768 bytes/cluster)
bps=512 spc=64 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=2 drv=0x80 bsec=585937504 bspf=71509 rdcl=2 infs=1 bkbs=6
Mounting disk
Formatting disk3s2 as MS-DOS (FAT32) with name NTFS
512 bytes per physical sector
/dev/rdisk3s2: 1367186816 sectors in 21362294 FAT32 clusters (32768 bytes/cluster)
bps=512 spc=64 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=585937507 drv=0x80 bsec=1367520669 bspf=166893 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished partitioning on disk3
/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *1.0 TB     disk3
   1:                 DOS_FAT_32 DOS                     300.0 GB   disk3s1
   2:                 DOS_FAT_32 NTFS                    700.2 GB   disk3s2

I have NTFS for mac on my laptop, so I then formatted the NTFS partition as an NTFS drive. Then I mounted my windows 10 iso file and copied the files to both partitions. (Again, I didn’t need to do this, but I didn’t realize that at the time.)

be:CPBA_X64FRE_EN-US_DV9 $ sudo cp -r . /Volumes/DOS
cp: /Volumes/DOS/./sources/install.wim: File too large
be:CPBA_X64FRE_EN-US_DV9 $ sudo cp -r . /Volumes/NTFS

At this point, I took the external drive to my windows laptop and started powershell as an administrator. The DOS drive came up as D and the NTFS drive came up as E.

I moved to the E:\sources directory and ran this:

PS E:\sources> Split-WindowsImage -imagepath install.wim -splitimagepath "D:\sources\install.swm" -FileSize 1024

It took about 10 minutes and then showed the log file. After that I was able to boot windows 10 and install it.

Computing Windows

Connecting to a Windows Remote Desktop from Linux

Our linux systems have xfreerdp installed. We can use that to connect to a windows desktop from linux. The command to use is:

xfreerdp -d DOMAINNAME -u username hostname

There are a bunch more options that you can see by running xfreerdp -h, but these were all I needed.

Computing Windows

The credentials are correct…

I had a problem where one user could not login to our windows server 2012 computer. The error message that I got was:

The credentials are correct, but the host cannot log you on for another reason. Please check if your password has expired or contact your system administrator for assistance.

This was weird because I didn’t have a problem with other users. And this user was able to ssh into our linux computers and was able to login to the windows 7 computers we had in the lab.

After doing an ldapsearch on both this problem user and a working user, I found that the issue was that the problem user didn’t have a tag “sambaPwdLastSet”. I have no idea how this got deleted, but once I added it, everything was fine.

Here’s the file that I used to add this field.

[~] $ more add_passwd_set.ldif 
dn: uid=problemuser,ou=people,dc=accounting,dc=example,dc=com
changetype: modify
add: sambaPwdLastSet
sambaPwdLastSet: 1394631807

Then I just made the change with:

[~] $ ldapmodify -x -D "cn=root,dc=accounting,dc=example,dc=com" -W -Z -f add_passwd_set.ldif 
Computing Insanity Windows

Deleting Autorun.inf Files

I don’t know why Windows 7 or the antivirus software I have, doesn’t let me delete autorun.inf files. To delete the file, do the following:

1. Start cmd
2. attrib -s -h -r autorun.inf
3. del autorun.inf