Wednesday, March 2, 2022

What tidbits of wisdom have you picked up along the way to use Powershell?

What tidbits of wisdom have you picked up along the way to use Powershell?

Honestly, I've started forgetting things along the way, so, I decided to put them up here.  Figuring others have had similar thoughts pass through their head, I believe it would be a good thread to share with new and experienced folks alike.  Here are a few of mine:

  1. Read the help files.  All of them.  As much as you can before you just totally get lost.  Then, about 6 months later, read them again.  Soap, lather, rinse, repeat.
  2. Find a mentor, user group, or, like minded soul who is as excited about this stuff as you...if not more.
  3. Keep journal, blog, personal history or whatnot.  It's amazing the progress you see over time.  And, I can't tell you how many times I have hit my own blog rather than revisiting a concept.  Code reuse applies to problem solving as well.  (Bruce Payette talks about how things are remembered ONLY when we explore it on our own AND retell the tale in Powershell In Action.  Very true.)
  4. Work on duplication (or test data) whenever possible.  I.e., preserve the original state as much as you can.
  5. Test before you run anything that will make real changes.  For me, this means a lot of Write-Output and -WhatIf
  6. Log as much as you can.  (I've really come to love Start-Transcript lately.)
  7. Take snapshots of data before you start working on it.  I recently started using Export-Clixml for this one.
  8. Version your scripts as much as you can to keep an audit trail in case you need to revisit something you did before you finalized you process/scripts.
  9. Try to find patterns and template them as much as possible.  If possible, move it into functions and modules to be even more productive.
  10. Try not to spend more time writing a script than it will take to run (or would otherwise take to manually accomplish the same task).  (Unless you are experimenting and just really like playing around.)  Managers don't like this sort of extravagance.
  11. Understand, Powershell is not the answer for everything...unfortunately.
  12. Know that someone has probably considered what you're looking at.  Make sure you're just not looking at the issue the wrong way.

I'm sure I'll think of more, but, this seems like a fun, useful discussion.  If there are others that have gone before, I apologize, I couldn't find them.


  • Edited by Will Steele Friday, January 20, 2012 9:48 PM extra comment

Reply:
For a lightweight approach to your
 >
 >  8. Version your scripts as much as you can to keep an audit trail in case you need to revisit
 >     something you did before you finalized you process/scripts.
 >
 
I have used the cmd.exe batch script below for many years
 
Suppose you have a file named myscript.ps1
 
The first time you run
  save myscript.ps1
it creates
  mysscript.ps1.!
The second time it creates
  mysscript.ps1.!!
etc...
 
C:> type \bin\save.bat
     @echo off % save.bat %
    if (%1)==() goto usage
    if not exist %1 goto nofile
      set saveext=!
    :trythatname
      set savename=%1.%saveext%
      if not exist %savename% goto makecopy
      set saveext=%saveext%!
      goto trythatname
    :makecopy
      echo copy %1 %savename%
           copy %1 %savename%
      goto eof
    :nofile
      echo                %1 does not exist!
      goto eof
    :usage
      echo usage: save filename
      echo         to create a backup of that file
    goto eof
    :eof
 

------------------------------------
Reply:

Do not do this:

$transcript = 'c:\somedir\transcript.txt'
start-transcript $transcript
get-content $transcript


[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "
  • Edited by mjolinor Saturday, January 21, 2012 12:22 AM

------------------------------------
Reply:

There are almost always multiple solutions.  A piece of script that is elegantly concise and intuitive to code and read can also be horribly inefficient.   If it's not inside a loop keep it, it's probably worth the overhead. 

 Inside of loops reduce objects to primitives if they don't have any useful methods.  If they have methods that can be used in place of powershell operators, use them when you can.  The utility of that advice will vary in proportion to the number of objects you send through that loop.

Avoid blocking cmdlets in pipelines that will handle large numbers of objects.  

Read all the documentation you can find on script blocks and pipelines, including the published specification.

Newer isn't always better.  Sometimes legacy methods work better.  A lot of times things like directory lookups can be accomplished much easier invoking a legacy command and parsing what you need out of the output, and be measurably faster. 

It should be generally considered bad practice to name variables after your family members and pets, functions after characters from Star Wars, or alias all of your cmdlets to their Klingon equivalents.

 

 

 


  • Edited by mjolinor Saturday, January 21, 2012 4:56 AM

------------------------------------
Reply:

Of all the points you mentioned, although all are valuable, I think the most salient is this one:

"Bruce Payette talks about how things are remembered ONLY when we explore it on our own AND retell the tale."

I find this is true for me.  If I find a new concept/structure/etc., I will not just look at an example and say "OK, got it".  I will try to find real-world applications, and write a script with this new (whatever), just to embed it properly into my brain.

And to add to what mj said, I think the naming of variable is very important for one's thought process.  Just calling things $a, $b, etc. is lazy, but if we give sensible names that relate to the type of object we're working with, we are less likely to make mistakes further down the line.

And a personal pet hate of mine is "foo" "bar".  I hate those words so much I can't express in a blog like this!


Grant Ward, a.k.a. Bigteddy

What's new in Powershell 3.0 (Technet Wiki)

Network Live Audit - Powershell script

------------------------------------

Re-install an old version of Office.

Recently my wife's HDD failed on her Laptop. I was able to replace it and get recovery discs to reinstall the OS. The only problem is that she has no idea how she got office on the computer because of it's age. It is a valid version Office 2003 and I am wondering if there is any way to get that back because I really don't want to put Office 2010 on an 8 year old laptop running XP. Thank you.

How to recreate System Mailbox , FederatedEmail & DiscoverySearchMailbox in Exchange 2010

I have Created a article on

How to recreate System Mailbox , FederatedEmail & DiscoverySearchMailbox

http://careexchange.in/?p=211

If people have some more good articles . Please post .will get to know more on this.

Arising Discovery mailbox issues. Will be resolved


Reply:

------------------------------------

duplicate-deleting

delete
  • Edited by NasLavaie Tuesday, January 24, 2012 7:29 PM
  • Changed type NasLavaie Tuesday, January 24, 2012 7:37 PM

Reply:
Duplicate post.
My Book - Active Directory, 4th Edition
My Blog - www.briandesmond.com

------------------------------------

Unable to view PDF files via internet explorer

Cannot view PDF files accessible on any website.

Reply:
Just got this new computer with Windows7 and internet explorer9 and if I cannot view PDF files on web sites or attached to e-mails I am returning the whole thing to the dump and buying an Apple system.

------------------------------------

Exchange 2003 OWA

when logging in to OWA, how do you set exchange OWA/IIS to automatically use the domain name instead of having to have users enter it?  Here is my problem...

for our internet filter to work correctly, we have to have "automatically logon in intranet site" checked under ie->tools->internet options->security->local intranet.

users are going to www.domainname.com/exchange to check their mail.

with the ie option turned on, they cant login as its passing the mail server fqdn (servername.domainname.com) intead of the ad domain name (domain.com). 

with windows 7 it works correctly( it pulls domain name) with vista and xp it doesnt work (pulls fqdn of machine)

how can I make this work?  in system manager->admin groups->servers->server name->protocols->http->exchange basic authentication and integrated windows authentication are checked and the default domain is "\"


Reply:

Take a look at this:

     http://support.microsoft.com/kb/903942

Looks like you need to remove the Integrated Windows Authentication.


JAUCG

------------------------------------
Reply:
Any updates on this?
JAUCG

------------------------------------

phone system on citrix servers and i cannot make calls from outlook

Hi,

I have this new phone system installed on all the citrix servers. and i would like the users to make a phone call from their outlook instead of punching the number. but for some reasons the citrix servers doesnt allow. For the standalone machines the users are able to make the call from the outlook.

If any one of you had any similar issues or have and thoughts can you please share.

Thank you

Cheers

Katty  


Reply:

This probably isn't the best forum for your topic. This is specifically for the Microsoft product Virtual Server 2005.

A better place would probably be a Citrix forum, or the vendor of your new phone system.


------------------------------------

The Browse Tab In SharePoint 2010 Ribbon

Hi!

I asked myself several times is it possible to customize the Browse tab of SharePoint Ribbon declaratively? The answer I found is NOT (of course you always have some workarounds). In the first place it's because of the nature of this special tab. I've made a blog post with some details: The Browse Tab In SharePoint 2010 Ribbon. I hope it clears the subject to someone. :)

i want to delet my toolbar

i want to delet my toolbar  how......?

Reply:

What toolbar are you talking about?  This seems like a question for another forum.

Chris


------------------------------------

Creating a skill/concept achievement chart for Powershell (warning: kind of long, over the top and geeky)

I recently was reading a book on music about perfect pitch.  The author talks about different levels of ability, and, he graded skills according to the different ways of thinking about music, composition, and, the mindset required to do each.  This idea/discussion got me thinking and was spawned, in part, by this thread:

http://dev9.channel9.msdn.com/blogs/c9team/Coming-Soon-Visual-Studio-Achievements

and, a little more tongue in cheek, on this one:

http://blog.whiletrue.com/2011/01/what-if-visual-studio-had-achievements/

Those things being said, what/how would you categorize things for someone starting from scratch through that of an expert?  This is, in many ways, completely arbitrary.  But, to mock myself, I am always trying to level up and sometimes don't even know where to jump next.  This may help me see the next few points of interest...as well as help others out when they try to share Powershell.  I figure this can give you a general progression as you help someone to know where to go next.  Honestly, I am trying to be exhaustive (or, as close as possible) and I'm using several books table of contents as the basis for this.  Writing helps me organize my thoughts/concepts. I put a Mindset: comment at the end of each "level" to make it easy to recognize the various shades and Aha! moments for each.

Level 1: (lost and doesn't know it) ABC's

  • cmdlets 
  • hello world
  • Get-Help
  • tab completion
  • variables: user created/built-in
  • there are versions
  • aliases: using/creating
  • Mindset: I just need to know what to type to get something I can recognize.

Level 2: (deer in headlights) Words are made from letters

  • New-Object
  • .NET objects/assemblies/reflection
  • common parameters
  • members
  • properties
  • methods
  • pipelining
  • one-lining
  • versions: there's a v1 versus v2 (and will be a v3)
  • types
  • extended type system (ETS)
  • Mindset:  Oh, wait! These isn't text, but, objects I'm playing with.

Level 3: (the sophomore) Paragraphs are made from words (when used correctly)

  • operators 
  • formatting
  • grouping
  • providers
  • profiles
  • scope
  • type accelerators
  • syntactical structures: dot sourcing, scripts (.ps1)
  • security (configuration/execution policies)
  • code signing
  • Mindset:  I see data like legos, and, am starting to realize I've got a pretty big toy chest

Level 4: (script writer) Chapters are made from paragraphs

  • customizing output
  • exploring modules
  • functions
  • filters
  • logic
  • scriptblocks
  • regular expressions
  • splatting
  • debugging
  • Mindset:  I think in terms of data types

Level 5: (developer) Write your own book -- There's always another way to say it

  • v3 starts looking very interesting because they know enough of the difficulties in the current incarnation
  • Add-Type
  • creating modules: script, complied, etc
  • Powershell SDK
  • Advanced functions/parameters
  • input validation
  • extending get-help
  • other technologies (AD, WMI, SQL, file system, registry, ADO.NET, XML, COM, IIS)
  • third-party Powershell tools/Open Source code
  • remoting/WinRM
  • jobs
  • VBScript to Powershell
  • Windows forms, XAML, WPF
  • Mindset:  I know a couple of languages, but, primarily speak .NET and ETS if I get lost and have to find my way back home.

Level 6: (architect/serious Powershell user) You can pretty much do anything and do it well so think about the larger community

  • best practices 
  • optimization
  • uses engineering to validate various code choices
  • hosts
  • cmdlet development (C#/Visual Studio)
  • dynamic compilation
  • unit testing
  • Internationalization
  • other .NET compliant languages to Powershell
  • serialization/web services
  • PInvoke and unmanaged code
  • recognizing limitations of Powershell and alternative solutions: i.e., pro's cons of the Powershell way
  • design patterns
  • Mindset:  everything is an object. I just went from Newtonian mechanics to Quantum physics.

Level 7: ("There is no spoon.") Ok, that's just freaky. Is that even possible? (I start getting fuzzy with this area as it's the way out there ideas and I'm not)

  • script fu
  • Powershell as a tool...not an end in an of itself
  • writing new GUI/subsystem extensions/MMC development
  • writing desktop hosts (think the PSShell.ps1 example from Windows Powershell Unleashed, 2nd Edition)
  • reverse engineering
  • Reflector with code to generate .NET from .dll's
  • assembly manipulation/code-injection/rootkits
  • live memory analysis for forensics (or more nefarious intents)
  • Powershell outside of Windows (I hear it's on Linux now...in theory)
  • Objects are just pretty stickers.  Who needs them when I've got YmFzZTY0, x68x65x78x69x64x65x63x69x6Dx61x6C, and, 
    110001011010011101110110000111100101111001. Be one with the data.  Zen of scripting.

  • Edited by Will Steele Thursday, January 5, 2012 2:42 PM additional comments

Reply:
I think, to some extent being an expert at powershell is like being a
windows expert... does a windows expert know how to program and support the
system as well as architect it? nope...
 
it would be like any course setup, as you get deeper in to it, you
specialize... in PowerShell there are a few 'paths', the "end user" who just
knows the basics (helpdesk to run scripts), the "admin" who is good at
simple functions, and creating quick onliners and knows the shortcuts to get
things done quickly... the dev admin, who knows how to create more advanced
functions to simplify tasks that are really difficult.. the "engineer" who
is a step above the "dev admin" because they are using PInvoke and such to
really dig deep in to the system... and then there is the "dev" guy who
writes cmdlets and knows the PS SDK...
 now, go clean up that list and break it up that way and give it course
numbers and hand it over to MS so that they can get some certs for it!
 
 

Justin Rich
http://jrich523.wordpress.com
PowerShell V3 Guide (Technet)
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

------------------------------------
Reply:

I know this is somewhat arbitrary, but, I used to have a system (which I have since quit using) where I would categorize things based on the number of times I used them.  (I realized frequency is a poor indicator of actual mastery.)  Nonetheless, I would say if I did something x times it got me to y level where:

  • 1 times means I have some raw experience.  This would be like level 1 from above (loosely).
  • 10 times means I have done it enough to see a pattern or two.  This would be like level 2.
  • 100 times means I have started to get enough practice to know the ins and outs of a particular thing. Level 3.
  • 1000 times means I not know how how a thing works but some of the warts, weaknesses, and, limits of a given thing. Level 4.
  • 10000 times means I not only know the limits but when I may want to consider alternatives, why and where to make these tradeoffs. Level 5.
  • 100000 times means I can accurately, and, more often than not, nail things the first time, with 10% of my attempts needing a little tweaking.  Level 6.
  • 1000000 times means I can intuit the applicable approaches (and some unseen ways) to utilize the technology that may not even be possible. Level 7.  Not only are you not wrong at this level, the things you do say are so deep/insightful, most people don't even realize what you're talking about.

As I said, a pretty arbitrary thing since some can get to level 6 in 5000 operations of a given task...but, this goes to the main concept of that book Outliers where a basic level of practice generally corresponds with a certain level of ability.  It may not be 10,000 hours, but, if you look at that, 10,000 would, using the unit of 8 hour days, 5 days a week, translate into about 3.5 years.  I would say, if someone really studies/uses Powershell every day and really attempts to maximize their understanding, 3.5 years seems about right to get to level 6.  Level 7 is something that I don't think everyone can achieve.  There are some people who will never "get it", but, chances are if you get to level 6, level 7 is just a matter of time, experience and persevering.  

Last time I checked, I saw that the certification committee was still not even considering a Powershell certificate.

http://www.windowsitpro.com/blog/powershell-with-a-purpose-blog-36/scripting-languages/why-no-powershell-certification-from-microsoft-137457

I would say things like MVP awards are clear recognition, but, that goes above and beyond just knowing Powershell.  Perhaps rankings in the scripting games would be an indirect indicator.  I like your scale: end user, admin, dev admin, engineer, and, dev.  At this point, I would say that I could see two certs: 1) the power user/small enterprise admin and 2) the enterprise admin/developer.  #1 would be a basic proficiency. #2 would be the true experts.  Ah, here's to pipe dreams.


------------------------------------
Reply:

Hello Will

 

I am really appreciate your thoughts here.  It's a great article and I think you can add it to the Windows PowerShell Survival Guide later after the discussion.

 

http://social.technet.microsoft.com/wiki/contents/articles/windows-powershell-survival-guide.aspx

 

Best Regards,

Greg Gu


Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

------------------------------------
Reply:
Some time ago I put together the list below.
 
There's no definite order to it, but it might fit a bit with what you
are thinking about.  Not anything "Zen" here, just brainstorming when
PowerShell was new to me.
 
"Top 25" PowerShell concepts to understand
 
- PowerShell executionpolicy
- PowerShell as command language
- PowerShell as scripting language
- PowerShell parsing modes
- PowerShell data types
- PowerShell comments
- PowerShell literals
- PowerShell providers
- PowerShell drives
- PowerShell cmdlets
- PowerShell functions
- PowerShell filters
- PowerShell scripts, including the PATH environment variable
- PowerShell profile scripts
- PowerShell interfacing with other script engines
- PowerShell aliases
- PowerShell abbreviations
- PowerShell scriptblocks
- PowerShell operators
- PowerShell variables
- PowerShell control flow
- PowerShell pipelines
- PowerShell file input and output
- PowerShell console output
- PowerShell is object oriented and leverages the .NET object model
 
 

------------------------------------
Reply:

------------------------------------
Reply:
Don Jones is a busy guy!  I hope to meet him some day.
 

------------------------------------
Reply:

On a similar note:

http://powershellverified.com/

Hadn't seen that one yet. Have to check it out.  Thanks for the link.

------------------------------------
Reply:
Thanks Larry. Good collection. I have been rediscovering Select-Object hidden nuggets: -ExpandProperty and Expressions.  Little gems for me.

------------------------------------
Reply:

just ran across the description for the five-day MS Powershell course, and was not sure if you had seen it:

    http://www.microsoft.com/learning/en/us/Course.aspx?ID=10325a#tab2

it seems to cover more areas than your list (i.e. background jobs). But it does not seek to clarify what "level" one might attain according to how much of the course one has covered.

 


------------------------------------
Reply:

I'm not sure that a strict geometric pattern is applicable to something like this. In any case, which is likely why you have stopped using this system. Anyway, if there is something you have done a million times, that would more likely imply an inability to find an easier way to do it.

I can only think offhand of a few things I have done a million times (blink, breathe, heartbeat), and am not concerned about not having found simpler alternatives. If you are 30 years old can you think of anything you have done 88 times a day since your birth?

 


------------------------------------
Reply:

I have run about 60,000 miles in my life.  So, I've put a few steps in. : )

Point taken.


------------------------------------
Reply:

just ran across the description for the five-day MS Powershell course, and was not sure if you had seen it:

    http://www.microsoft.com/learning/en/us/Course.aspx?ID=10325a#tab2

it seems to cover more areas than your list (i.e. background jobs). But it does not seek to clarify what "level" one might attain according to how much of the course one has covered.

 

Thanks Al.  I appreciate the link.  That whole idea of "level" is arbitrary in regards to real world applications.  It steers more in the direction of conceptual limits.  For instance, I know folks who were great in math as high school students, did pretty well through undergrad, but, hit a wall in graduate school.  In this respect, I think there are conceptual levels some of us may simply not be able to reach.  At the same time, I suspect this limit correlates with exposure to different aspects of Powershell.  Someone coming from the sysadmin side may balk at things like Add-Type because they lack the requisite development experience.  Likewise, and, conversely, someone who is purely dev-oriented may not fully see the implications of some of the AD, Sharepoint, Exchange or IIS cmdlets.  That's one of the things that makes Powershell an even more interesting creature for me: you have to know both sides of the fence to fully harness the power of Powershell.  That is not to say that you can't still get an amazing amount by being skilling on one side of the fence (sysadmin) or the other (dev).  Reminds me of the right brain/left brain debate.

------------------------------------
Reply:
I'm definitely on only the "dev" side of that fence, and am having fun at least picking up some
vocabulary of the "sysadmin" side by eavesdropping.
 
 

------------------------------------
Reply:

I think there's at least one more "hat" being worn in the Powershell audience - Integrator. 

 I'm mostly a sysadmin, and I occasionally go visiting on the "developer" side of the fence, but I also get called on to find ways to make disparate systems from different vendors work and play together, sometimes in ways neither vendor anticipated their product being used. That work doesn't quite fit into either the sysadmin or the developer pigeon hole.

In that environment, Powershell is Swiss Army knives, duct tape, and zip ties all rolled into one.


[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

------------------------------------
Reply:
Ah, you busted me with my false dichotomy: dev or sysadmin. : ) I would say I fall more into the niche you mentioned mjolinor.  I often jokingly ask if people need duct tape or WD-40 when I offer to script.  I'll have to remember zip ties for my analogy.  Those come in handy too.

------------------------------------
Reply:
I do that a lot, but I wouldn't consider that another role. I am a sysadmin
and its my job to make the systems work together and automate everything I
can.
 
I think that is more a combo of the two roles rather than a different role.
That would be like saying the person who handles storage and servers is a
special role. I feel it has more to do with the company/environment size as
well as skill level.
 
In order to integrate systems you need to fully understand how the system
works and how to get data out of it as well as be able to code the
transforms, which as you've hinted at is more than the typical admin coding
ability.
 
so as far as "course" paths that type of person would want to head down both
paths.
 
 

Justin Rich
http://jrich523.wordpress.com
PowerShell V3 Guide (Technet)
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

------------------------------------
Reply:
Hmmm...  I see integrator as being a valid role, at least for me, because puts a label on what I do quite nicely.  I am not a developer by nature (although I can go there) and I am not a sysadmin (but it can be done if necessary).  For me, it really is more about using whatever tools I can to get the integration done.  Getting off topic now, but, I see sysadmins as key to keeping things up and running (stability is the focus).  Developers create the tools for end users and sysadmins to work (tools are the focus).  But, integrators are not expected to focus on stability or tools.  Both are important, but, their job is targeted elsewhere.  For instance, if we have a major SQL configuration change on our system, I'm going to let a SQL DBA or dev deal with that.  However, if I am working with a customer, some of the contorted hacks I come up with to combine data into viable business solutions make no sense to either the dev or the admin.  For me (the person for whom the business/integrations are key) my main focus is the project, not the environment or tools used to build/maintain it.  Hence, my non-technical title: warehouse manager. : )  Sorry, logistics analysis specialist.

------------------------------------
Reply:
I think you can argue it's neither or both, but either way it doesn't always come down to being an either/or situation.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

------------------------------------
Reply:
Do your solutions have a long "run" (in the theatrical sense of being performed again and again
over a long span of time), or are they one-time performances?
 On 1/20/2012 1:01 PM, Will Steele wrote:
> ,,,  However, if I am working
> with a customer, some of the contorted hacks I come up with to combine data into viable business
> solutions make no sense to either the dev or the admin. For me (the person for whom the
> business/integrations are key) my main focus is the project, not the environment or tools used to
> build/maintain it. Hence, my non-technical title: warehouse manager. : ) Sorry, logistics analysis
> specialist.
 
 

------------------------------------
Reply:
Do your solutions have a long "run" (in the theatrical sense of being performed again and again
over a long span of time), or are they one-time performances?
Um... Both, actually.  We deal with customers whose data is processed once.  But, since I work in a niche industry (document imaging) many of the same vendors work with our customer base.  When we get new customers it is common to see data from a new customer that is retrieved from a system we have worked with before.  So, while the data is new, the formats, tables, structures, and, techniques used to process it are not.  In this sense, I often just modify variables in my scripts, and, things run smoothly without having to be reinvented each time around.  Plus, I do a lot of cookbook and templating since the processing is very repetitive, even though minor aspects of the data storage structure change.

------------------------------------
Reply:

Hence, my non-technical title: warehouse manager. : )

Mine is Tactical Logician. :)


[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

------------------------------------
Reply:
mine is Sr Systems Magician
 
who comes up with these things?!
 

Justin Rich
http://jrich523.wordpress.com
PowerShell V3 Guide (Technet)
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

------------------------------------
Reply:
I think you are actually just proving my point.. there are two different
items here...
 
Skills
Job Role
 
you are talking about the job role and what it takes to complete it where as
im talking about skills sets. and as I point out, for you rob and myself we
play both sides of the fence and our skill set must be fairly heavy on both
sides.
 
maybe im looking at this wrong but for the idea of achievements/skills we'd
want to be able to say we are very knowledgeable in both areas.. which, is
what makes us good integrators...
 
maybe we've gone too far off topic and are talking about two very different
things.
 
 

Justin Rich
http://jrich523.wordpress.com
PowerShell V3 Guide (Technet)
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

------------------------------------
Reply:

Good differentiation between skills and roles.

I think I felt a bump back there a few posts ago. Seems like I hit a shark and went airborne.


------------------------------------

Exchange 2007 - Room Resource Booking - Use ROOMS button without direct booking?

Can anyone tell me if there is a way to allow users to book room resources using the "rooms" button in outlook WITHOUT allowing direct booking?

If it is not possible can someone explain the logic in not allowing this ability?  I know I'm going to have 50 people asking me why they can't use the rooms button to choose the conference room they want.


Reply:

Who will accept the requests?


Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

------------------------------------
Reply:

The preference would be for the resource to auto-accept and reject conflicts.

If that's not possible I'm sure I can find a volunteer.


------------------------------------
Reply:

I'm not sure what you're asking.  Use of the "Rooms" button doesn't direct book, it invites the resource and a message is sent to the resource mailbox.


Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

------------------------------------

Runtime Error when trying to view pdf file from website

I am having probelm while opening a pdf from the website and it throws me the following error. Did try to do reasearch and find solution, couldn't find any useful materials. 
Error:
Runtime Error!
Program: C:\Prpgram Files\Internet Explorer\IExplore.exe
This application has requested the runtime to terminate it in an unusual way. Please contanct the application's support team for more information.
Steps I am doing is:
1) I am basically opening a pdf file from a website. It throws this error for the first time. After this, the IE closes.
2) Now I open a new browser and do the same steps it produces the output without any error.
My observa
  • Changed type Niki Han Monday, January 23, 2012 2:05 AM
  • Moved by Carey FrischMVP, Moderator Monday, June 11, 2012 5:30 AM Moved to more appropriate forum (From:Windows 7 Application Compatibility)

Reply:

Which Internet Explorer version are you using? Which Adobe Acrobat (or any other PDF viewer) version are you using?
Check the Windows "Application" log in the Event Viewer to see if there's any record related to this problem; then post more detailed informations here about the problem and yous system.

Bye.


Luigi Bruno - Microsoft Community Contributor 2011 Award

------------------------------------
Reply:

Follow the thread at the following address

http://social.technet.microsoft.com/Forums/it-IT/w7itproappcompat/thread/7538dd9b-683d-4e8e-b6c2-96849ae96a24

Please, do not post repeatedly the same question.

Bye.


Luigi Bruno - Microsoft Community Contributor 2011 Award

------------------------------------
Reply:

Thanks for your reply. I am using Adobe Reader 9.5 and running on Windows XP, SP 3 and IE 7.0. I did try to see the error in Event Viewer under Control Panel -->Administrative Tools-->Event View-->Internet Explorer. But no logs were present. I also, tested in Windows 7, IE 8 with Adobe Reader 9.5 and same result. I had to re-post the question because,  http://social.technet.microsoft.com  site wasn't allowing me to post the question. After a few try's it posted, but only part of question. So I had to redo it again and tried in different browsers, but no use. Apologies for that. Here is my complete question. Hope it works this atleast. Is there a way where I can email the question to this forum? If yes, please let me know the email id. anycase, here's another try to post the question.

I am having probelm while opening a pdf from the website and it throws me the following error. Did try to do reasearch and find solution, couldn't find any useful materials.

Error:

Runtime Error!

Program: C:\Prpgram Files\Internet Explorer\IExplore.exe

This application has requested the runtime to terminate it in an unusual way. Please contanct the application's support team for more information. 

Steps I am doing is:

1) I am basically opening a pdf file from a website. It throws this error for the first time. After this, the IE closes.

2) Now I open a new browser and do the same steps it produces the output without any error.

 

My observation: When the PDF file is downloaded for the first time, it went to the temp folder. and IE threws up the above error message. So the nexttime when the same file is requested, the IE didn't say any error and it opened the file. Now, I deleted the pdf from the temp folder and tried to access the pdf from the web site. Again, the error appeared.

 

Can any one let me know the real reason for this and fix for this problem.


------------------------------------
Reply:

You are also posting in the WRONG forum.

Note the subject of this forum is Windows 7 Application Compatibility with the emphasis on Windows 7.

The Windows XP Service Pack 3 (SP3) forum is @ http://social.technet.microsoft.com/Forums/en-US/itproxpsp/threads


Please remember to click "Mark as Answer" on the post that helps you, and to click "Unmark as Answer" if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. "

------------------------------------

Research button

reasearch button doesn't function

 


Reply:

Hi,

 

Which Internet Explorer version are you using? What is the means of "research button"? Is it the find function?

 

Please reset Internet Explorer for a test.


Niki Han

TechNet Community Support


------------------------------------
Reply:

reasearch button doesn't function


Did it ever work?   What changed?   Sounds like you should try uninstalling it and reinstalling it.   Also, I think you need to have Office installed to use it, so perhaps a repair of Office would help too?...

http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/troubleshooting-problem-with-research-button-on/23ee88e9-887e-43eb-8caa-06db109a5aa4

(Microsoft search for
     office research "Internet Explorer"
- Community Categories filtered by MIcrosoft Answers
)

 

Good luck

Robert Aldwinckle
---


------------------------------------

migrate two different domain in different forest with external trust in to one domain and one forest

we need to migrate to migrate two different domain in different forest with external trust in to one domain and one forest the both domain in different sites and what will happen if we the connection between the two sites is down.

Reply:

For performing migration, you need connectivity, dns name resolution, ports on firewall being allowed, trust in place etc to perform migration. If connection is down between source and destination domain migration will not work.

 

Regards  


Awinish Vishwakarma

MY BLOG:  awinish.wordpress.com


This posting is provided AS-IS with no warranties/guarantees and confers no rights.

------------------------------------
Reply:

thanks for your replay but i asking after migration if the connection is down so are all authantication and logon process in the other site will efected and can i make like a passive domain controller in the other site to work when connection is down

 

 


------------------------------------
Reply:

As long atleast one of the DC in the domain holding the user object is available it will authenticate the users. But, if all the DC in particular site is down, it will locate the DC in closest or another sites, considering the DNS is configured in the clients NIC and sites and subnet is configured properly in AD sites and services.Its better to have at least two dc in a site to avoid single DC failure.

http://support.microsoft.com/kb/247811

http://blogs.dirteam.com/blogs/jorge/archive/2007/07/02/dc-locator-process-in-w2k-w2k3-r2-and-w2k8-part-3.aspx

http://msmvps.com/blogs/acefekay/archive/2010/01/03/the-dc-locator-process-the-logon-process-controlling-which-dc-responds-in-an-ad-site-and-srv-records.aspx

 

Regards  


Awinish Vishwakarma

MY BLOG:  awinish.wordpress.com
This posting is provided AS-IS with no warranties/guarantees and confers no rights.

------------------------------------
Reply:
ok so i have to make 2 DC one in the main office and the other in the site office but wich operation master should be on the main DC and on the site DC to be insure that when the connection is down the both site users can work and authanticate normaly.

------------------------------------
Reply:

Normally, the critical FSMO role is dc holding the PDCEmulator, but there is no immediate impact when it is down. Other FSMO role can be down for sometime which will not impact normal functioning. You can keep all the FSMO role on one DC or other and there is no concept of primary/secondary DC all DC behaves same apart from the RODC. Make all DC DNS and GC too.

http://support.microsoft.com/kb/223346

 

Regards


Awinish Vishwakarma

MY BLOG:  awinish.wordpress.com


This posting is provided AS-IS with no warranties/guarantees and confers no rights.

------------------------------------
Reply:
If I understand it correctly are are doing an inter-forest migration, then the following will not apply, but if you are performing any migration between domains within the same forest, also known as intra-forest migration, the FSMO RID Master becomes critical.
 
"

Cross-Domain Moves

Migrating AD DS objects from one domain to another requires the availability of the RID master. You can only move an object out of its domain if the domain's RID master can be contacted. Requiring that objects be moved from one domain to another by using the RID master prevents AD DS from creating two objects in different domains with the same unique identifier. This might happen if one object is moved from two domain controllers simultaneously to two different domains.

You can use the Active Directory Migration Tool (ADMT) to perform intraforest migrations of domain objects from one domain (the source domain) to another (the target domain). The RID master must be online and available in the source domain for ADMT to migrate successfully. If the RID master is unavailable, cross-domain migration of AD DS objects will fail.

"
 
----------------------------------------------------------
Regards
Christoffer Andersson – Principal Advisor
Enfo Zipper

"Awinish" wrote in message news:34a7197d-c60e-4f78-89cb-0b7b10fb349d...

Normally, the critical FSMO role is dc holding the PDCEmulator, but there is no immediate impact when it is down. Other FSMO role can be down for sometime which will not impact normal functioning. You can keep all the FSMO role on one DC or other and there is no concept of primary/secondary DC all DC behaves same apart from the RODC. Make all DC DNS and GC too.

http://support.microsoft.com/kb/223346

 

Regards


Awinish Vishwakarma

MY BLOG:  awinish.wordpress.com


This posting is provided AS-IS with no warranties/guarantees and confers no rights.

Enfo Zipper Christoffer Andersson – Principal Advisor

------------------------------------
Reply:

Hi,

I have some questions about our Migration plan, this is our scenario:

We have 2 diferent forest , each one with one domain. For now we're working with a trust relationship. Each domain has Exchange infrastructure, OCs and Share Point , so the first part of our migration plan is migrate users, profiles and computers but I wonder what will happend with those services (Exchange, OCS an Share Point)...They will be accesible after I made the users, profiles and computers migration?

The second part of this project will be mailboxes migration and OCS.

Thanks for your help.

Regards

 


------------------------------------
Reply:

Users should able to access all resources in the source domain using SID History after the migration – make sure to use SID History during the migration.  However, some application doesn’t honor SID History.  Then you need to manually re-ACL the application/resource.  An example is SharePoint. After the user migration, you need change the permission.

File, print server etc, you can perform a re-ACL /Security Translation from the migration tool itself.  Which migration tool are you planning to use?


Santhosh Sivarajan | MCTS, MCSE (W2K3/W2K/NT4), MCSA (W2K3/W2K/MSG), CCNA, Network+| Houston, TX
Blogs - http://blogs.sivarajan.com/

FaceBook Twitter LinkedIn SS Tech Forum

This posting is provided AS IS with no warranties,and confers no rights.

------------------------------------
Reply:

Thanks Santhosh

 

For users migration we will use ADMT ver 3.1.

Any suggestion will be appreciate.

Regards 


------------------------------------

Windows 7 shuts down, even in safe mode.

Ok so here are some of the basics

OS : Win 7 Pro 64bit

Mobo : Abit MF-M2S

CPU : AMD Athlon Dual Core 2.41GHz

Graphics : ATI Radeon HD 4350

Memory : 2x 1gig kingston HyperX

Power : Power Magic 550W

Opitcs/ HDD : 1x Asus DVD-RW Sata; Maxtor 160gig IDE, Seagate 80gig IDE

Case : Rosewill Challenger

 

Ok, so the problem has put me into a dead end. I have tried most of the solutions around net and still nothing. If this presist, i might be bald by the end of the year. In the begining I did a clean install of win 7, after awhile I got an error message stating that no boot disk was availible, however it didn't always come up, so I let it go, and eventually fixed it by changing BIOS settings. Things where good for a while, then my comp started to randomly shut down. It was at this point I started to get a DMI pool crash. I could get into Win 7 sometimes but it would randomly shut down as if I pulled the power cable. I replace my memsticks and that problem durring boot up went away and could continue to boot normally. However the problem persisted while in Windows and it still shut down randomly and with increasing frequancy too, not to mention I had a new sympton (a unknown coprocesser, which I have already fixed) I tried to enter safe mode and it seemed to be stable, but it shut down again. ><

So here is where I stand,

I have installed Win 7 on the secondary HDD and booted into safe mode, It seem stable for now. Any other boot option fails usally with in minutes of start up. (Update, secondary hdd in safe mode crashed after about 25 min)

I have disabled both of my audio drivers for now.

I have done a memtest, results where negitive

I have tried to do a driver verifier, but system crashes durring opperation.

I checked the event veiwer and it says I had a Event 41, Kernal- Power error, Bugcheckcode was 0. I ckecked the log even further and realized that every time the computer crashed, I was do to this error.

I have tried to update drivers, however it crashes durrion use.

 

Im slowly loosing my mind and money. Need a solution ASAP. If any one could help with this I would very gratfull. If you need any other details just ask, and I will be happy to inform you.


Reply:

Have you try adjusting the voltage and timing for the ram? If you're not sure, go to kingston HyperX site and have a look at the recommended latency timings and voltage for your ram. Alternatively ensure your processor is not heating up, verify it under cmos setup in bios, either on hardware monitor or health status depending which bios you're having

Lastly i assume you didn't OC your rig?


------------------------------------
Reply:

You are corect in assuming that I don't OC my rig. I have watched my temp from bios and it never goes over 30 degrees C. I have also watched it on speed fan, and that always stays in the low 30's range for the temp.

The next thing I plan to do is check the voltage on the PSU with a multimeter, I will update as soon as I get some results.

As a side note, I probally did not mention that it was shutting down even before I replace the RAM, the only differance is that it no longer shuts down at a DMI pool screen. Now it waits to I start to log in then shuts down.


------------------------------------
Reply:

As mention earlier on, change the voltage and ram timing and see how it goes, cos personally came across similar using kingston HyperX on a new rig, it crashes but once i swap to value ram or adjust the recommended timing it stays fine

In the mean time if it still crash after trying the above, you might wanna run chkdsk or download the uitlity from both harddrive manufacturer site to run a test on the drive itself, since i notice you mention DMI POOL CRASH


------------------------------------
Reply:

I had a little difficulty reading the multimeter test, if I was placing the probes corectly, it read around 13 volts on the 12 volt line. I also took off the cpu fan a noticed that the thermite paste was almost completly gone. I intend to reapply some paste and try again. While I was looking around my appartment looking for some paste, I started to wonder if the CPU could heat up and cause it to shut down even though it was reading at the low 30's. Does the temp reading go off the fan, or is it else where?


------------------------------------
Reply:

Shane said:  

"I also took off the cpu fan a noticed that the thermite paste was almost completly gone."

 

I believe he meant "THERMAL paste." 

The use of thermite in computers is NOT recommended!


------------------------------------

Catching WCF Faults in BizTalk Orchestrations

I've just been fixing some error handling on a project and I've recovered SOAP Fault's with WCF consumed services.  This is with BizTalk 2006 R2, but I believe it's the same in 2010 et all.

As we all already know, it doesn't matter what you do, there is no way to get those pesky Fault operations to match up to a receive location.  Instead we have to use a Catch block with an Exception matching the Fault operation.

What then happens is this fails to work due to unexpected message types and such.  To get it to catch correctly we need to propagate  the fault in the Send Port configuration and add a custom return body path as per Microsoft's documentation.

The snag with this is you must know what your response root node is going to be (which inevitability will be forgotten and then setup wrong when you build a new server).  And if you have one Send Port dealing with many different messages you have to write some super-long Xpaths.

As a SOAP:Fault is a child to SOAP:Body and not an alternative you need to check for it's absence to make it generic.  I thought I'd share this with everybody to try and save some headaches:

/*[not(namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/')] | /*[namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/' and local-name()='Fault']/detail/*

This will return whatever body content that isn't relating to SOAP, OR return the fault detail - which should hopefully match up with your Exception object in your Orchestration.  This will also avoid all those Zombies that appear with faults if not handled correctly.

If you want to get more detail out of the fault in your Orchestration, either find the generated fault schema and promote the relevant fields, or use the XPath() function.

Hope this helps somebody.


If this is helpful or answers your question - please mark accordingly.
Because I get points for it which gives my life purpose (also, it helps other people find answers quickly)

Reply:

Instead, you can declare the Fault as XmlDocument in your logical port and you can catch it in the catch block.

Thanks


SKGuru

------------------------------------
Reply:

Personally, I'd rather not do this as it involves changing the generated code - whilst it solves the issue, if somebody else comes along and has to regenerate the service (e.g. if the contract has been updated), then they will need to know to do this.

And Up-Typed stuff makes me feel dirty ;)


If this is helpful or answers your question - please mark accordingly.
Because I get points for it which gives my life purpose (also, it helps other people find answers quickly)

------------------------------------

Unidentified IP Traffic (TCP:38705) Denied Connection None - see Result Code 0x80074e23 FWX_E_CONCURRENT_CONNECTIONS_QUOTA_EXCEEDED_DROPPED

Unidentified IP Traffic (TCP:38705) Denied Connection None - see Result Code 0x80074e23 FWX_E_CONCURRENT_CONNECTIONS_QUOTA_EXCEEDED_DROPPED

 


ibrahim waz

Reply:

The source made to many connections to the TMG thus you should take a look a flood mitigation settings (or an malware infected host)

 

regards

richard


------------------------------------
Reply:

Hi ,richard

this error appears when we download from torrents and i wand to allow this traffic it is not a malware

 


ibrahim waz
  • Edited by ibrahim_waz Friday, January 20, 2012 2:34 PM

------------------------------------

cube security based on a security table

Hi Gurus,

I have designed a cube with one main table role playing as 1 fact and few  dimensions. and Deployed it is working fine. but now I have a security table with userId column and col1 col2 . col1 and col2 are in main table too but not user Id field.

Now I want security to be enfored on the cube such that the user who is running the cube can only see the data based on col1 and col2 values from security table. How can I do this. Please help me with this.


  • Edited by Spartaa Friday, January 20, 2012 3:45 PM

Reply:

Assuming your User ID column contains the Windows AD username of your users, you can apply dynamic security as per below...

  1. Add your security table to the Cube DSV, joining it to the main table using Col1 and Col2
  2. Create a security dimension based on the security table you've added in the DSV, including the User ID field as an attribute
  3. Add the dimension to existing cube, you'll probably also want to set visible to false on this dimension
  4. Create a new role containing the users you want to give access to the cube, you'll need to set the appropriate permissions
  5. In the newly create role, select dimension data tab
  6. From the dimension drop down select your security dimension
  7. Under the dimension drop down, click the Advanced tab
  8. Select the User ID attribute from the Attribute drop down
  9. Assuming your attribute is called User ID, paste the following MDX into the allowed member set box...
      StrToSet ( '[Security].[User ID].&[' + UserName() + ']' )  
  10. Save and deploy the cube

What the above is doing is getting the current users username, and converting it to the relevant User ID member in the security dimension. This will then restrict the records returned by the fact table to only those joining to the selected User ID.


David Stewart | My Microsoft BI Blog | @dstewartbi

------------------------------------
Reply:
Assuming your User ID column contains the Windows AD username of your users, you can apply dynamic security as per below...
  1. Add your security table to the Cube DSV, joining it to the main table using Col1 and Col2
  2. Create a security dimension based on the security table you've added in the DSV, including the User ID field as an attribute
  3. Add the dimension to existing cube, you'll probably also want to set visible to false on this dimension
So here, how can I map the fact and dimension in the Dimension Usage tab. (I meant what type of relation and between what?).

------------------------------------
Reply:
You could concatenate columns Col1 and Col2 in the DSV (something like Col1|Col2) in both the main and security table, then join on this in the DSV and dimension usage tab.
David Stewart | My Microsoft BI Blog | @dstewartbi

------------------------------------
Reply:

Hi

Here we could also use Reference_Relation from Security DIM to FACT via Original DIM, so when the user access the data, the FACTs will be sliced by inner join the Original DIM.

Consider the Default member set and Allowed member set while adding the StrToSet in the role.


Prav

------------------------------------
Reply:

------------------------------------
Reply:
You could concatenate columns Col1 and Col2 in the DSV (something like Col1|Col2) in both the main and security table, then join on this in the DSV and dimension usage tab.

The datatype of these columns are nvarchar so when I tried to implement (col1 | Col2 ) It says it could not be completed due to the datatypes.

Please let me know If I am doing correct??


------------------------------------
Reply:

Hi

Here we could also use Reference_Relation from Security DIM to FACT via Original DIM, so when the user access the data, the FACTs will be sliced by inner join the Original DIM.

Consider the Default member set and Allowed member set while adding the StrToSet in the role.


Prav


Hi Prav_SQL,

 

I did not understnad what do u mean by Orignial DIM . Here, I only have security DIM and my original fact table . The remaining DIMS are derived from this fact table so I cannot see them in the DSV or in the cube designer window.

I am wrong can you please explain me, !


------------------------------------
Reply:
Can anyone help me with this please ???? thanks

------------------------------------

Working with IIS in XP mode

Hi,

I have installed IIS on XP mode . and created a test website.  now iis stops working  in every 2-3 mins. Every time i need to start IIS . suddely is display page cann't found. If i starts IIS then evry thing is fine.. Can some one give me suggestion in any more extra settings to be made in IIs on XP mode.

 

Thanks,

Kiran

 

  • Changed type Niki Han Wednesday, January 25, 2012 10:43 AM
  • Changed type Niki Han Wednesday, January 25, 2012 10:43 AM

Reply:

Hi Kiran,

 

The issue can be related to IIS configuration, I suggest posting in IIS forum for help.

 

http://forums.iis.net/


Niki Han

TechNet Community Support


------------------------------------

genuine windows validation

i recently bought used computer,after done updates on it,it saying you may be victim of software counterfeiting this copy of windows did not pass genuine windows validation,it windows xp how can i fix this,i can get download nomore updates or play windows media player or the adobe reader,please help me anyone,my email tracy1_1975@hotmail.com
  • Changed type Nicholas Li Friday, January 27, 2012 6:44 AM

Reply:

Hi,

 

Since this problem is a Windows XP related issue, and our forum mainly focus on Windows 7. Please post your question to Microsoft Windows XP SP3 forum:

http://social.technet.microsoft.com/Forums/en/itproxpsp/threads

 

The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. 


William Tan

TechNet Community Support


------------------------------------

No comments:

Post a Comment

Setup is Split Across Multiple CDs

Setup is Split Across Multiple CDs Lately I've seen a bunch of people hitting installation errors that have to do with the fact th...