Friday, May 24, 2013

Pull computer information remotely in cmd, using WMIC

I recently had a request to pull the serial number for one of our remote workstation.  I wouldn't be able to get hands on the machine, and figured I should be able to do this without calling the user and asking them to flip over their machine.
Enter WMIC
My first search "serial number through cmd" brought me to this site:
http://blogs.technet.com/b/aviraj/archive/2010/08/13/how-to-find-a-machine-serial-number-from-command-prompt-using-wmi.aspx
where I learned the run command was
wmic bios get serialnumber

So I tried it on my computer, success, I got my serial number.  Now... how do I go about getting another computers serial number?  Remember, I would like to avoid calling the user in this scenario.

So I looked up WMIC and found Microsoft's write up on the subject.
Here is Microsoft's write up of WMIC and what it can do:
http://technet.microsoft.com/en-us/library/bb742610.aspx

Under the "Putting WMIC to work" section they have this bit of scripting:
LISTING 1: Code to Display
Results at the
Console from a WMIC Batch File
wmic /node:SERVER1, SERVER4
     cpu get name, caption,
     maxclockspeed, systemname
     /format:textvaluelist.xsl

The part I bolded contained my answer.
The script I ran looked like this:
wmic /node:(computer's ip address) bios get serialnumber
I tried going through the computer name here, but it didn't work.

UPDATE:
I've been poking around with this wmic and figured I could get HDD processor and memory information to start building an upgrade list.
I used these commands to get the info I wanted:

HDD size: wmic /node:(ip address) diskdrive get size

Total installed memory: wmic /node:(ip address) computersystem get totalphysicalmemory

Processor Type:wmic /node:(ip address) cpu get name

Installed Software: wmic /node:(ip address) product get name,version

I had to get software for multiple computers, so instead of copying everything out of the command prompt, I ran this script:

Installed software export to file: wmic /output:c:\(path) /node:(ip address) product get name,version

I supposed one day I'll be able to script these better, but for now I'm running CMD as a network admin account (instead of just running normal, or running as admin, I ran as other user)

Tuesday, May 7, 2013

Word stacks letters on top of each other

Or, why does word say I have more characters than I can see?
I came across a strange one today.
User had a word document that showed it had 100s of words, but only took up about a page.  And the page looked like one of those secret government files where names and locations have been blacked out.  Or word was showing strange characters or something like that.
After a little google-fu I found highlighting all the text and changing the font or font size brought everything back.

Monday, April 29, 2013

This operation has been canceled due to restrictions in effect on this computer. Please contact your system administrator.

Do you have this error?
I've seen it before, and recently saw it again.  But I noticed I didn't have it on my internet cache of things I do all the time, so I'm adding it here.
First,
Close Outlook
Then reset IE to factory defaults
(Tools, Internet Options, Advanced Tab, Reset, click the checkbox for personal settings also.)
Let it do its thing, close IE and open it back up
Selected the option to set IE as the default browser and try Outlook links again.

Still not working?
Time for some regediting
go to the registry editor (run 'regedit') and find this path:
HKEY_CURRENT_USER\Software\Classes\
we are going to change .html extensions from either ChromeHTML or FireFoxHTML to HTMLfile.
I also go through and change .htm, .xhtml, etc. to HTMLfile.  Whatever was pointing to Chrome of Firefox, change to HTMLfile.
Try Outlook again and you'll notice the 'restrictions' message doesn't come up, rather the linked webpage did.
If it didn't, make sure you followed the directions here, if it still doesn't work let me know if you find some other solution!

Friday, April 19, 2013

Excel: the file is corrupt and cannot be opened

I take 0 credit in this post, it is complete and utter rip from here:
http://www.ablebits.com/office-addins-blog/2011/11/30/excel-open-corrupt-files/
If you get this error:

The file is corrupt and cannot be opened in Excel 2010
  1. Open the application.
  2. Click on File -> Options.
  3. Select Trust Center and press the Trust center settings button.
    title=
  4. Pick Protected view.
  5. Uncheck all the options under Protected View and confirm by pressing OK.
  6. Restart Excel and try to open the broken Excel documents.

Back to my words.
This worked for me recently when a user couldn't open a document that everyone else could.  I tried opening and resaving the document, tried opening from different locations.  Different users saved it for her and sent it, nothing worked.  I found this gem at http://www.ablebits.com/office-addins-blog/2011/11/30/excel-open-corrupt-files/ and was able to resolve the issue.

Thanks again Ablebits!

Wednesday, April 10, 2013

Before deleting E-Mail account containing your personal mail, contacts and calender data, you must create a new location for your data

Have you ever had the error:
"Before deleting E-Mail account containing your personal mail, contacts and calender data, you must create a new location for your data. To create a new data location, open the Account Settings dialog box, click the Data Files tab, and then click Add."
when trying to remove an exchange email account from Email Account?
Well I have.
Usually when I'm running my general outlook fix because there are random issues with outlook.
Well I googled my way to another answer.
When you get the error:
"Before deleting E-Mail account containing your personal mail, contacts and calender data, you must create a new location for your data. To create a new data location, open the Account Settings dialog box, click the Data Files tab, and then click Add."
Simply remove the profile.
When you go to the Mail applet, select Show Profiles, and remove the profile that is there. 

Also, You will have to create a new profile before adding the email account.

Wednesday, March 20, 2013

Blue border in IE only


I made a flowchart into a clickable image map so I could make the different points of the flowchart clickable for further instruction.  In firefox this worked great, but in IE there was an ugly blue border around the image.
The first fix I found was here: http://webdev-il.blogspot.com/2009/12/how-to-remove-blue-link-image-border-in.html
using the css style sheet to remove the border using
However when I did this, nothing happened.
I didn't know if it was because I was using an image map or something, but adding this into my CSS file didn't do anything.
what did work was using
border="none"
as an image attribute.  So the line of code for the image map looked like this:
<img class="center" src="new.png" usemap="#newmap" border="none" />
<map name="newmap">

Then after fiddling with it, and remembering what CSS does again, I added
border:none;
To the class I created called center.  Which I made so the image would stay centered.  That code ended up looking like this:
.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    border:none
}
I figured it might not have worked because I already had a CSS class assigned to the image, and maybe CSS wouldn't assign 2 attributes to it.  I don't know if this is what was actually going on, but adding "border:none" to the existing class assigned to the image removed the blue border.
Adding "border=none" also worked for me.  I only have one image on the pages I'm working on so either way works for me, if you are using multiple images, adding to CSS is the way to go.

Saturday, March 9, 2013

Flash error: tempInit

My full error was tempInit, Line 4 1086:Syntax error:expecting semicolon before me.







Usually I'll have some actionscripting by the time I get errors referencing lines, but at this point in my project all I had were buttons, so it was kinda driving me mad.  There was no line 4 in code, so I had no idea what was going on.
Turns out it was a button named "about me" apparently you can't have AS linkage with spaces in it.
And its not that it even really wanted a semicolon between About and Me, because that just threw even more errors.
So moral of the story, keep your AS linkage names one word.  Even if its screwyouASlinkage, as long as there aren't any spaces, you're good to go.

Wednesday, February 20, 2013

Auto-reply on shared mailbox in an Exchange environment

This one is a major PITA being in help desk and having no access to the exchange console.  Although, I've never had access to the exchange console so that might not help...
Anyway, to add the auto response to a share mailbox, first the user has to have access to the shared mailbox (duh)
Go to the Control Panel, Mail, Show Profiles
You're going to Add a new profile, name it whatever you'd like (I'd recommend using the shared mailbox name)
Go to Manually Configure, since the user won't have a password for the shared mailbox
Choose service MS Exchange
Enter the Exchange Server address and the name of the account.
Finish.

**Note: On the Show Profiles page, there is a selection for Prompt for a Profile to be used, select this option so you can select the new profile when you open Outlook.

Close and Open Outlook selecting the profile you just created.

Now you can create the auto reply rule.

Select New Rule
select "Apply to Messages I Receive"
select "Sent only to me" or "Where My Name is in the To Box" whichever you prefer
select "Have Server reply using a specific message" then click the "a specific message" at the bottom.
This will open an email window, leave the from and to fields blank.  Give it a subject and a body, a nice full body, with 'a sort of oaky afterbirth' (office quote sickos!) if possible.
Click Next and Finish and test it.


Monday, February 18, 2013

Error 1046:Type was not found or was not a compile-time constant: (button reference)

I'm learning flash ActionScript and came across the error.
Error 1046:Type was not found or was not a compile-time constant: (button reference)
Apparently it can be a lot of things.  For me, I had the "Instance Of" name matching the "Instance Name".  It took me a while, but I finally realized these names have to be different after talking it through with someone.  I hope this helps anyone else new to Action Script 3.0 with their similar headache.


The wrong way:
 The acceptable way:


Monday, February 11, 2013

Outlook 2010 unable to view free/busy information, and my outlook 'Fix All'

If you work in a corporate IT help desk, you've probably seen this one.
(Before you read any further, check to see if the account is in cached exchange mode, remove that checkmark if they are and restart Outlook, sometimes that clears it up.)
When a user goes to the scheduling assistant and puts in another users name, they see a grey bar full of slashes.
Googling "no free busy outlook 2010" or any other clever way you decide to search it, brings up a number of different solutions.  Many seemed to be server configuration side when I searched.  If you work in help desk like I do, you probably don't have access to these kinds of system settings.  And honestly none of it makes sense to me anyway.
Well after searching for a while, and having nothing work, I did my "fix all" for Outlook as a last shot in the dark.  And it worked, the user could see other people's free and busy schedules in calendar.
This was all done on a machine running Outlook 2010 and Windows 7.  So my directions will reflect this.
First, I removed the Exchange account from Outlook.
First, close Outlook.  Then go to the Control Panel, then Email, Select the user's exchange account and remove it.
That's step one, easy peasy
Next, you're going to want to remove the .ost file, which is the local store of the emails on the server, this could be completely wrong, but its how I understand it.  Either way, opening outlook after removing the .ost will rebuild the .ost file, so we aren't losing any data here.  MAKE SURE NOT TO DELETE .PST FILES, this will probably put you in hot water.  The .pst files are offline files users use for archiving.
The location is as follows:
C:\Users\%user%\AppData\Local\Microsoft\Outlook
It's safe to delete everything but the .pst files in this folder.
Don't delete the .pst.
See the .pst files?  Don't delete those.
Once that folder is all cleared out, go back to Mail in Control Panel and add the account.
Open outlook and let everything sync up.  Once that is done check the Free/Busy. 

This is what worked for me.

This also works for just about any "WTF is outlook doing?" issues.  Going slow, missing folders that are available on the web access, attachments aren't opening or going slow, but other MS office products are working fine, etc, etc etc.

Update:
Still not showing free/busy info?
Then it might be related to autodiscover, this is how I ended up forcing the connection and getting free/busy to populate:
Go into the connection tab of the email account
(file>account settings>account settings>double click account>more settings>connection>check Exchange Proxy Settings>enter your OWA address information)
I then selected the check marks for both:
On fast networks, connect using HTTP first, then connect using TCP/IP
On slow networks, connect using HTTP first, then connect using TCP/IP
The way we are setup, this left everything checked on the Exchange Proxy Settings page.

If you have a better way, let me know and I'll include it here.


Tuesday, February 5, 2013

Ah google search, thank you for jumping to conclusions

I found this old picture on my hard drive and through I'd throw it up here.  I thought this was pretty funny.  It doesn't work anymore, but luckily I got a screen capture of it... jeez, back in 2011... 

 

Google frauds, get sent to craigslist.  Thank you google, you just made my day.

ModuleNotFoundError: No module named 'torchvision.transforms.functional_tensor'

 I tried a couple things, downgrading, reinstalling, followed some github links talking about /usr/local/lib/python3.10/dist-packages/basics...